Files
grzanieplus.pl/plugins/stCeneoPlugin/lib/stCeneoTask.class.php
2025-03-12 17:06:23 +01:00

37 lines
781 B
PHP

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