src/Entity/ProjectDeliverable.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProjectDeliverableRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ProjectDeliverableRepository::class)
  9.  */
  10. class ProjectDeliverable
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $title;
  22.     /**
  23.      * @ORM\Column(type="text", nullable=true)
  24.      */
  25.     private $description;
  26.     /**
  27.      * @ORM\Column(type="date", nullable=true)
  28.      */
  29.     private $delivery_date;
  30.     /**
  31.      * @ORM\Column(type="float")
  32.      */
  33.     private $percentage;
  34.     /**
  35.      * @ORM\Column(type="date")
  36.      */
  37.     private $planned_delivery_date;
  38.     /**
  39.      * @ORM\Column(type="boolean")
  40.      */
  41.     private $verify_deliverable;
  42.     /**
  43.      * @ORM\Column(type="datetime")
  44.      */
  45.     private $created_at;
  46.     /**
  47.      * @ORM\ManyToOne(targetEntity=User::class)
  48.      * @ORM\JoinColumn(nullable=false)
  49.      */
  50.     private $created_by;
  51.     /**
  52.      * @ORM\OneToMany(targetEntity=ProjectDeliverableStatus::class, mappedBy="deliverable")
  53.      */
  54.     private $projectDeliverableStatuses;
  55.     /**
  56.      * @ORM\ManyToOne(targetEntity=Project::class, inversedBy="projectDeliverables")
  57.      * @ORM\JoinColumn(nullable=false)
  58.      */
  59.     private $project;
  60.     /**
  61.      * @ORM\ManyToOne(targetEntity=ProjectMilestone::class, inversedBy="projectDeliverables")
  62.      * @ORM\JoinColumn(nullable=false)
  63.      */
  64.     private $milestone;
  65.     public function __construct()
  66.     {
  67.         $this->projectDeliverableStatuses = new ArrayCollection();
  68.     }
  69.     public function getId(): ?int
  70.     {
  71.         return $this->id;
  72.     }
  73.     public function getTitle(): ?string
  74.     {
  75.         return $this->title;
  76.     }
  77.     public function setTitle(string $title): self
  78.     {
  79.         $this->title $title;
  80.         return $this;
  81.     }
  82.     public function getDescription(): ?string
  83.     {
  84.         return $this->description;
  85.     }
  86.     public function setDescription(?string $description): self
  87.     {
  88.         $this->description $description;
  89.         return $this;
  90.     }
  91.     public function getDeliveryDate(): ?\DateTimeInterface
  92.     {
  93.         return $this->delivery_date;
  94.     }
  95.     public function setDeliveryDate(\DateTimeInterface $delivery_date): self
  96.     {
  97.         $this->delivery_date $delivery_date;
  98.         return $this;
  99.     }
  100.     public function getPercentage(): ?float
  101.     {
  102.         return $this->percentage;
  103.     }
  104.     public function setPercentage(?float $percentage): self
  105.     {
  106.         $this->percentage $percentage;
  107.         return $this;
  108.     }
  109.     public function getPlannedDeliveryDate(): ?\DateTimeInterface
  110.     {
  111.         return $this->planned_delivery_date;
  112.     }
  113.     public function setPlannedDeliveryDate(\DateTimeInterface $planned_delivery_date): self
  114.     {
  115.         $this->planned_delivery_date $planned_delivery_date;
  116.         return $this;
  117.     }
  118.     public function getVerifyDeliverable(): ?bool
  119.     {
  120.         return $this->verify_deliverable;
  121.     }
  122.     public function setVerifyDeliverable(bool $verify_deliverable): self
  123.     {
  124.         $this->verify_deliverable $verify_deliverable;
  125.         return $this;
  126.     }
  127.     public function getCreatedAt(): ?\DateTimeInterface
  128.     {
  129.         return $this->created_at;
  130.     }
  131.     public function setCreatedAt(\DateTimeInterface $created_at): self
  132.     {
  133.         $this->created_at $created_at;
  134.         return $this;
  135.     }
  136.     public function getCreatedBy(): ?User
  137.     {
  138.         return $this->created_by;
  139.     }
  140.     public function setCreatedBy(?User $created_by): self
  141.     {
  142.         $this->created_by $created_by;
  143.         return $this;
  144.     }
  145.     /**
  146.      * @return Collection|ProjectDeliverableStatus[]
  147.      */
  148.     public function getProjectDeliverableStatuses(): Collection
  149.     {
  150.         return $this->projectDeliverableStatuses;
  151.     }
  152.     public function addProjectDeliverableStatus(ProjectDeliverableStatus $projectDeliverableStatus): self
  153.     {
  154.         if (!$this->projectDeliverableStatuses->contains($projectDeliverableStatus)) {
  155.             $this->projectDeliverableStatuses[] = $projectDeliverableStatus;
  156.             $projectDeliverableStatus->setDeliverable($this);
  157.         }
  158.         return $this;
  159.     }
  160.     public function removeProjectDeliverableStatus(ProjectDeliverableStatus $projectDeliverableStatus): self
  161.     {
  162.         if ($this->projectDeliverableStatuses->removeElement($projectDeliverableStatus)) {
  163.             // set the owning side to null (unless already changed)
  164.             if ($projectDeliverableStatus->getDeliverable() === $this) {
  165.                 $projectDeliverableStatus->setDeliverable(null);
  166.             }
  167.         }
  168.         return $this;
  169.     }
  170.     public function getProject(): ?Project
  171.     {
  172.         return $this->project;
  173.     }
  174.     public function setProject(?Project $project): self
  175.     {
  176.         $this->project $project;
  177.         return $this;
  178.     }
  179.     public function __toString()
  180.     {
  181.         return $this->title;
  182.     }
  183.     public function getMilestone(): ?ProjectMilestone
  184.     {
  185.         return $this->milestone;
  186.     }
  187.     public function setMilestone(?ProjectMilestone $milestone): self
  188.     {
  189.         $this->milestone $milestone;
  190.         return $this;
  191.     }
  192. }