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

39 lines
884 B
PHP

<?php
class stTaskPropelLogger extends stTaskLogger
{
/**
* Instancja modelu Task
*
* @var Task
*/
protected $task;
/**
* Undocumented variable
*
* @var stEventDispatcher
*/
protected $dispatcher;
/**
*
* @param Task $task Instancja modelu Task
*/
public function __construct(Task $task, stEventDispatcher $dispatcher)
{
$this->task = $task;
$this->dispatcher = $dispatcher;
}
public function log(int $type, string $message, array $messageParams = null): stTaskLoggerInterface
{
$log = new TaskLog();
$log->setType($type);
$log->setTask($this->task);
$log->setMessage($messageParams ? '@'.serialize(array($message, $messageParams)) : $message);
$log->save();
return parent::log($type, $message, $messageParams);
}
}