<?php
namespace App\Ship\Entities;
use App\Containers\CompanySection\EmployeeContainer\Entities\EmployeeEntity;
use App\Containers\CrmSection\TaskContainer\Entities\TaskCommentEntity;
use App\Containers\CrmSection\ContractContainer\Entities\ContractCommentEntity;
use App\Containers\OscpvSection\ContractContainer\Entities\ContractCommentEntity as OscpvContractCommentEntity;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Serializer\Annotation\Groups;
#[ORM\Entity]
#[ORM\InheritanceType('SINGLE_TABLE')]
#[ORM\DiscriminatorColumn(name: 'entity_type', type: 'string')]
#[ORM\DiscriminatorMap([
'task' => TaskCommentEntity::class,
'contract' => ContractCommentEntity::class,
'oscpv_contract' => OscpvContractCommentEntity::class
])]
class CommentEntity
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: Types::INTEGER)]
private ?int $id = null;
#[ORM\Column(type: Types::TEXT)]
#[Groups(['read'])]
protected string $text;
#[Gedmo\Timestampable(on: "create")]
#[ORM\Column(type: "datetime")]
#[Groups(['read'])]
protected $createdAt;
#[Gedmo\Timestampable(on: "update")]
#[ORM\Column(type: "datetime")]
protected $updatedAt;
#[ORM\ManyToOne(targetEntity: EmployeeEntity::class)]
#[ORM\JoinColumn(name: 'created_by', referencedColumnName: 'id')]
#[Gedmo\Blameable(on: 'create')]
#[Groups(['read'])]
protected $createdBy;
#[ORM\ManyToOne(targetEntity: EmployeeEntity::class)]
#[ORM\JoinColumn(name: 'updated_by', referencedColumnName: 'id')]
#[Gedmo\Blameable(on: 'update')]
protected $updatedBy;
public function getId()
{
return $this->id;
}
public function getText()
{
return $this->text;
}
public function setText($text)
{
$this->text = $text;
return $text;
}
public function getOwner() {
return $this->updatedBy;
}
public function getCreatedBy()
{
return $this->createdBy;
}
public function getCreatedAt()
{
return $this->createdAt;
}
}