src/Ship/Entities/CommentEntity.php line 22

Open in your IDE?
  1. <?php
  2. namespace App\Ship\Entities;
  3. use App\Containers\CompanySection\EmployeeContainer\Entities\EmployeeEntity;
  4. use App\Containers\CrmSection\TaskContainer\Entities\TaskCommentEntity;
  5. use App\Containers\CrmSection\ContractContainer\Entities\ContractCommentEntity;
  6. use App\Containers\OscpvSection\ContractContainer\Entities\ContractCommentEntity as OscpvContractCommentEntity;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Gedmo\Mapping\Annotation as Gedmo;
  10. use Symfony\Component\Serializer\Annotation\Groups;
  11. #[ORM\Entity]
  12. #[ORM\InheritanceType('SINGLE_TABLE')]
  13. #[ORM\DiscriminatorColumn(name'entity_type'type'string')]
  14. #[ORM\DiscriminatorMap([
  15.     'task' => TaskCommentEntity::class,
  16.     'contract' => ContractCommentEntity::class,
  17.     'oscpv_contract' => OscpvContractCommentEntity::class
  18. ])]
  19. class CommentEntity
  20. {
  21.     #[ORM\Id]
  22.     #[ORM\GeneratedValue]
  23.     #[ORM\Column(typeTypes::INTEGER)]
  24.     private ?int $id null;
  25.     #[ORM\Column(typeTypes::TEXT)]
  26.     #[Groups(['read'])]
  27.     protected string $text;
  28.     #[Gedmo\Timestampable(on"create")]
  29.     #[ORM\Column(type"datetime")]
  30.     #[Groups(['read'])]
  31.     protected $createdAt;
  32.     #[Gedmo\Timestampable(on"update")]
  33.     #[ORM\Column(type"datetime")]
  34.     protected $updatedAt;
  35.     #[ORM\ManyToOne(targetEntityEmployeeEntity::class)]
  36.     #[ORM\JoinColumn(name'created_by'referencedColumnName'id')]
  37.     #[Gedmo\Blameable(on'create')]
  38.     #[Groups(['read'])]
  39.     protected $createdBy;
  40.     #[ORM\ManyToOne(targetEntityEmployeeEntity::class)]
  41.     #[ORM\JoinColumn(name'updated_by'referencedColumnName'id')]
  42.     #[Gedmo\Blameable(on'update')]
  43.     protected $updatedBy;
  44.     public function getId()
  45.     {
  46.         return $this->id;
  47.     }
  48.     public function getText()
  49.     {
  50.         return $this->text;
  51.     }
  52.     public function setText($text)
  53.     {
  54.         $this->text $text;
  55.         return $text;
  56.     }
  57.     public function getOwner() {
  58.         return $this->updatedBy;
  59.     }
  60.     public function getCreatedBy()
  61.     {
  62.         return $this->createdBy;
  63.     }
  64.     public function getCreatedAt()
  65.     {
  66.         return $this->createdAt;
  67.     }
  68. }