mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
88 lines
1.5 KiB
PHP
88 lines
1.5 KiB
PHP
<?php
|
|
|
|
/**
|
|
* 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.
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Chill\MainBundle\Entity\Embeddable;
|
|
|
|
use DateTime;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
/**
|
|
* @ORM\Embeddable
|
|
*/
|
|
class CommentEmbeddable
|
|
{
|
|
/**
|
|
* @ORM\Column(type="text", nullable=true)
|
|
*/
|
|
private ?string $comment = null;
|
|
|
|
/**
|
|
* @var DateTime
|
|
* @ORM\Column(type="datetime", nullable=true)
|
|
*/
|
|
private $date;
|
|
|
|
/**
|
|
* Embeddable does not support associations.
|
|
*
|
|
* @var int
|
|
* @ORM\Column(type="integer", nullable=true)
|
|
*/
|
|
private $userId;
|
|
|
|
public function getComment(): ?string
|
|
{
|
|
return $this->comment;
|
|
}
|
|
|
|
/**
|
|
* @return DateTime
|
|
*/
|
|
public function getDate()
|
|
{
|
|
return $this->date;
|
|
}
|
|
|
|
/**
|
|
* @return interger $userId
|
|
*/
|
|
public function getUserId()
|
|
{
|
|
return $this->userId;
|
|
}
|
|
|
|
public function isEmpty()
|
|
{
|
|
return empty($this->getComment());
|
|
}
|
|
|
|
public function setComment(?string $comment)
|
|
{
|
|
$this->comment = $comment;
|
|
}
|
|
|
|
/**
|
|
* @param DateTime $date
|
|
*/
|
|
public function setDate(?DateTime $date)
|
|
{
|
|
$this->date = $date;
|
|
}
|
|
|
|
/**
|
|
* @param int $userId
|
|
*/
|
|
public function setUserId($userId)
|
|
{
|
|
$this->userId = $userId;
|
|
}
|
|
}
|