15 private $errorCollection;
21 private function __construct()
26 private static function createHandler() :
self
33 return new EventResult($this->getEventStatus(), [
'ERROR_COLLECTION' => $this->errors()]);
36 private function getEventStatus() :
int
38 return $this->
hasErrors() ? EventResult::ERROR : EventResult::SUCCESS;
43 return $this->errorCollection;
48 return $this->errorCollection->count() > 0;
51 private function setClientId($clientId) :
self
55 if (!isset($clientId))
57 $this->errorCollection->setError(
new Main\
Error(
"client is null"));
59 $this->clientId = $clientId;
65 private function setEngineCode($code) :
self
71 $this->errorCollection->setError(
new Main\
Error(
'Engine code is not string'));
77 private function run() :
self
81 $row = Internals\ServiceQueueTable::getRow([
84 'CLIENT_ID' => $this->clientId,
85 '=SERVICE_TYPE' => $this->code,
90 $result = Internals\ServiceQueueTable::delete($row[
'ID']);
93 $this->errors()->add(
$result->getErrors());
110 static::createHandler()
111 ->setClientId($clientId)
112 ->setEngineCode($engineCode)