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