mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-30 10:29:42 +00:00
42 lines
915 B
PHP
42 lines
915 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/*
|
|
* Chill is a software for social workers
|
|
*
|
|
* For the full copyright and license information, please view
|
|
* the LICENSE file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Chill\TaskBundle\Event;
|
|
|
|
use Chill\MainBundle\Entity\User;
|
|
use Chill\TaskBundle\Entity\SingleTask;
|
|
use Symfony\Contracts\EventDispatcher\Event;
|
|
|
|
class AssignTaskEvent extends Event
|
|
{
|
|
final public const PERSIST = 'chill_task.assign_task';
|
|
|
|
public function __construct(
|
|
private readonly SingleTask $task,
|
|
private readonly ?User $initialAssignee,
|
|
) {}
|
|
|
|
public function getTask(): SingleTask
|
|
{
|
|
return $this->task;
|
|
}
|
|
|
|
public function getInitialAssignee(): ?User
|
|
{
|
|
return $this->initialAssignee;
|
|
}
|
|
|
|
public function hasAssigneeChanged(): bool
|
|
{
|
|
return $this->initialAssignee !== $this->task->getAssignee();
|
|
}
|
|
}
|