38 lines
781 B
PHP
38 lines
781 B
PHP
<?php
|
|
|
|
class stRadarTask extends stTask
|
|
{
|
|
protected $radar;
|
|
|
|
public function initialize()
|
|
{
|
|
|
|
$this->radar = new stRadar();
|
|
$this->radar->setCLI($this->isCLI());
|
|
}
|
|
|
|
/**
|
|
* W tej metodzie zwracamy ile rekordów/danych zamierzamy wykonać
|
|
*/
|
|
public function count(): int
|
|
{
|
|
return $this->radar->getStepsCount();
|
|
}
|
|
|
|
public function started() {
|
|
$this->radar->init();
|
|
}
|
|
|
|
public function finished() {
|
|
$this->radar->close();
|
|
}
|
|
|
|
/**
|
|
* W tej metodzie wykonujemy swoje operacje na danych
|
|
*
|
|
*/
|
|
public function execute(int $offset): int
|
|
{
|
|
return $this->radar->generate($offset);
|
|
}
|
|
} |