first commit
This commit is contained in:
38
plugins/stOkazjePlugin/lib/stOkazjeTask.class.php
Normal file
38
plugins/stOkazjePlugin/lib/stOkazjeTask.class.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
class stOkazjeTask extends stTask
|
||||
{
|
||||
protected $okazje;
|
||||
|
||||
public function initialize()
|
||||
{
|
||||
|
||||
$this->okazje = new stOkazje();
|
||||
$this->okazje->setCLI($this->isCLI());
|
||||
}
|
||||
|
||||
/**
|
||||
* W tej metodzie zwracamy ile rekordów/danych zamierzamy wykonać
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return $this->okazje->getStepsCount();
|
||||
}
|
||||
|
||||
public function started() {
|
||||
$this->okazje->init();
|
||||
}
|
||||
|
||||
public function finished() {
|
||||
$this->okazje->close();
|
||||
}
|
||||
|
||||
/**
|
||||
* W tej metodzie wykonujemy swoje operacje na danych
|
||||
*
|
||||
*/
|
||||
public function execute(int $offset): int
|
||||
{
|
||||
return $this->okazje->generate($offset);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user