src/Entity/ProjectDeliverable.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Logs;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use App\Entity\DeliverableVersions;
  7. use Doctrine\Common\Collections\Collection;
  8. use App\Repository\ProjectDeliverableRepository;
  9. use Doctrine\Common\Collections\ArrayCollection;
  10. use Symfony\Component\Serializer\Annotation\Groups;
  11. #[ORM\Entity(repositoryClassProjectDeliverableRepository::class)]
  12. class ProjectDeliverable
  13. {
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column]
  17.     #[Groups('projects:admin-get-all')]
  18.     private ?int $id null;
  19.     #[ORM\Column(length255)]
  20.     #[Groups('projects:admin-get-all')]
  21.     private ?string $title null;
  22.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  23.     #[Groups('projects:admin-get-all')]
  24.     private ?string $description null;
  25.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  26.     #[Groups('projects:admin-get-all')]
  27.     private ?\DateTimeInterface $createdAt null;
  28.     #[ORM\ManyToOne]
  29.     #[ORM\JoinColumn(nullablefalse)]
  30.     #[Groups('projects:admin-get-all')]
  31.     private ?Status $status null;
  32.     #[ORM\ManyToOne(inversedBy'projectDeliverables')]
  33.     private ?Project $project null;
  34.     #[ORM\Column]
  35.     #[Groups('projects:admin-get-all')]
  36.     private ?int $forecast_versions null;
  37.     #[ORM\OneToMany(mappedBy'deliverable'targetEntityDeliverableVersions::class, cascade:['persist','remove'])]
  38.     private Collection $deliverableVersions;
  39.     #[ORM\OneToMany(mappedBy'livrable'targetEntityLogs::class, cascade:['remove'])]
  40.     #[ORM\OrderBy(['createdAt'=>'DESC'])]
  41.     private Collection $logs;
  42.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullable:true)]
  43.     #[Groups('projects:admin-get-all')]
  44.     private ?\DateTimeInterface $LivraisonDate null;
  45.     #[ORM\ManyToOne]
  46.     private ?ProjectType $type null;
  47.     public function __construct()
  48.     {
  49.         $this->deliverableVersions = new ArrayCollection();
  50.         $this->logs = new ArrayCollection();
  51.     }
  52.     public function getId(): ?int
  53.     {
  54.         return $this->id;
  55.     }
  56.     public function getTitle(): ?string
  57.     {
  58.         return $this->title;
  59.     }
  60.     public function setTitle(string $title): self
  61.     {
  62.         $this->title $title;
  63.         return $this;
  64.     }
  65.     public function getDescription(): ?string
  66.     {
  67.         return $this->description;
  68.     }
  69.     public function setDescription(?string $description): self
  70.     {
  71.         $this->description $description;
  72.         return $this;
  73.     }
  74.     public function getCreatedAt(): ?\DateTimeInterface
  75.     {
  76.         return $this->createdAt;
  77.     }
  78.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  79.     {
  80.         $this->createdAt $createdAt;
  81.         return $this;
  82.     }
  83.     public function getStatus(): ?Status
  84.     {
  85.         return $this->status;
  86.     }
  87.     public function setStatus(?Status $status): self
  88.     {
  89.         $this->status $status;
  90.         return $this;
  91.     }
  92.     public function getProject(): ?Project
  93.     {
  94.         return $this->project;
  95.     }
  96.     public function setProject(?Project $project): self
  97.     {
  98.         $this->project $project;
  99.         return $this;
  100.     }
  101.     public function getForecastVersions(): ?int
  102.     {
  103.         return $this->forecast_versions;
  104.     }
  105.     public function setForecastVersions(int $forecast_versions): self
  106.     {
  107.         $this->forecast_versions $forecast_versions;
  108.         return $this;
  109.     }
  110.     /**
  111.      * @return Collection<int, DeliverableVersions>
  112.      */
  113.     public function getDeliverableVersions(): Collection
  114.     {
  115.         return $this->deliverableVersions;
  116.     }
  117.     public function addDeliverableVersion(DeliverableVersions $deliverableVersion): self
  118.     {
  119.         if (!$this->deliverableVersions->contains($deliverableVersion)) {
  120.             $this->deliverableVersions->add($deliverableVersion);
  121.             $deliverableVersion->setDeliverable($this);
  122.         }
  123.         return $this;
  124.     }
  125.     public function removeDeliverableVersion(DeliverableVersions $deliverableVersion): self
  126.     {
  127.         if ($this->deliverableVersions->removeElement($deliverableVersion)) {
  128.             // set the owning side to null (unless already changed)
  129.             if ($deliverableVersion->getDeliverable() === $this) {
  130.                 $deliverableVersion->setDeliverable(null);
  131.             }
  132.         }
  133.         return $this;
  134.     }
  135.     /**
  136.      * @return Collection<int, Logs>
  137.      */
  138.     public function getLogs(): Collection
  139.     {
  140.         return $this->logs;
  141.     }
  142.     public function addLog(Logs $log): self
  143.     {
  144.         if (!$this->logs->contains($log)) {
  145.             $this->logs->add($log);
  146.             $log->setLivrable($this);
  147.         }
  148.         return $this;
  149.     }
  150.     public function removeLog(Logs $log): self
  151.     {
  152.         if ($this->logs->removeElement($log)) {
  153.             // set the owning side to null (unless already changed)
  154.             if ($log->getLivrable() === $this) {
  155.                 $log->setLivrable(null);
  156.             }
  157.         }
  158.         return $this;
  159.     }
  160.     public function getLivraisonDate(): ?\DateTimeInterface
  161.     {
  162.         return $this->LivraisonDate;
  163.     }
  164.     public function setLivraisonDate(?\DateTimeInterface $LivraisonDate): self
  165.     {
  166.         $this->LivraisonDate $LivraisonDate;
  167.         return $this;
  168.     }
  169.     public function getType(): ?ProjectType
  170.     {
  171.         return $this->type;
  172.     }
  173.     public function setType(?ProjectType $type): self
  174.     {
  175.         $this->type $type;
  176.         return $this;
  177.     }
  178. }