mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-16 23:34:23 +00:00
153 lines
2.6 KiB
PHP
153 lines
2.6 KiB
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\Entity\Task;
|
|
|
|
use Chill\MainBundle\Entity\User;
|
|
use DateTimeImmutable;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
/**
|
|
* AbstractTaskPlaceEvent.
|
|
*
|
|
* @ORM\MappedSuperclass
|
|
*/
|
|
class AbstractTaskPlaceEvent
|
|
{
|
|
/**
|
|
* @ORM\ManyToOne(
|
|
* targetEntity="\Chill\MainBundle\Entity\User"
|
|
* )
|
|
*/
|
|
private ?\Chill\MainBundle\Entity\User $author = null;
|
|
|
|
/**
|
|
* @ORM\Column(name="data", type="json")
|
|
*/
|
|
private array $data = [];
|
|
|
|
/**
|
|
* @var datetime_immutable
|
|
*
|
|
* @ORM\Column(name="datetime", type="datetime_immutable")
|
|
*/
|
|
private $datetime;
|
|
|
|
/**
|
|
* @var int
|
|
*
|
|
* @ORM\Column(name="id", type="integer")
|
|
* @ORM\Id
|
|
* @ORM\GeneratedValue(strategy="AUTO")
|
|
*/
|
|
private ?int $id = null;
|
|
|
|
/**
|
|
* @ORM\Column(name="transition", type="string", length=255)
|
|
*/
|
|
private string $transition = '';
|
|
|
|
public function __construct()
|
|
{
|
|
$this->datetime = new DateTimeImmutable('now');
|
|
}
|
|
|
|
public function getAuthor(): User
|
|
{
|
|
return $this->author;
|
|
}
|
|
|
|
/**
|
|
* Get data.
|
|
*/
|
|
public function getData(): array
|
|
{
|
|
return $this->data;
|
|
}
|
|
|
|
/**
|
|
* Get datetime.
|
|
*
|
|
* @return datetime_immutable
|
|
*/
|
|
public function getDatetime()
|
|
{
|
|
return $this->datetime;
|
|
}
|
|
|
|
/**
|
|
* Get id.
|
|
*
|
|
* @return int
|
|
*/
|
|
public function getId()
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
/**
|
|
* Get transition.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getTransition()
|
|
{
|
|
return $this->transition;
|
|
}
|
|
|
|
public function setAuthor(User $author)
|
|
{
|
|
$this->author = $author;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Set data.
|
|
*
|
|
* @return AbstractTaskPlaceEvent
|
|
*/
|
|
public function setData(array $data)
|
|
{
|
|
$this->data = $data;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Set datetime.
|
|
*
|
|
* @param datetime_immutable $datetime
|
|
*
|
|
* @return AbstractTaskPlaceEvent
|
|
*/
|
|
public function setDatetime($datetime)
|
|
{
|
|
$this->datetime = $datetime;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Set transition.
|
|
*
|
|
* @param string $transition
|
|
*
|
|
* @return AbstractTaskPlaceEvent
|
|
*/
|
|
public function setTransition($transition)
|
|
{
|
|
$this->transition = $transition;
|
|
|
|
return $this;
|
|
}
|
|
}
|