src/Entity/ProjectMilestone.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProjectMilestoneRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ProjectMilestoneRepository::class)
  9.  */
  10. class ProjectMilestone
  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 $name;
  22.     /**
  23.      * @ORM\Column(type="text", nullable=true)
  24.      */
  25.     private $description;
  26.     /**
  27.      * @ORM\ManyToOne(targetEntity=Project::class, inversedBy="projectMilestones")
  28.      * @ORM\JoinColumn(nullable=false)
  29.      */
  30.     private $project;
  31.     /**
  32.      * @ORM\Column(type="date", nullable=true)
  33.      */
  34.     private $last_revision;
  35.     /**
  36.      * @ORM\ManyToOne(targetEntity=User::class)
  37.      * @ORM\JoinColumn(nullable=false)
  38.      */
  39.     private $created_by;
  40.     /**
  41.      * @ORM\Column(type="datetime")
  42.      */
  43.     private $created_at;
  44.     /**
  45.      * @ORM\OneToMany(targetEntity=ProjectMilestoneStatus::class, mappedBy="milestone")
  46.      */
  47.     private $projectMilestoneStatuses;
  48.     /**
  49.      * @ORM\OneToMany(targetEntity=ProjectActivity::class, mappedBy="milestone")
  50.      */
  51.     private $projectActivities;
  52.     /**
  53.      * @ORM\Column(type="boolean")
  54.      */
  55.     private $activities_equal_weight;
  56.     /**
  57.      * @ORM\OneToMany(targetEntity=ProjectDeliverable::class, mappedBy="milestone")
  58.      */
  59.     private $projectDeliverables;
  60.     /**
  61.      * @ORM\Column(type="integer")
  62.      */
  63.     private $weight;
  64.     /**
  65.      * @ORM\Column(type="date")
  66.      */
  67.     private $start_date;
  68.     /**
  69.      * @ORM\Column(type="date")
  70.      */
  71.     private $end_date;
  72.     public function __construct()
  73.     {
  74.         $this->projectMilestoneStatuses = new ArrayCollection();
  75.         $this->projectActivities = new ArrayCollection();
  76.         $this->projectDeliverables = new ArrayCollection();
  77.     }
  78.     public function getId(): ?int
  79.     {
  80.         return $this->id;
  81.     }
  82.     public function getName(): ?string
  83.     {
  84.         return $this->name;
  85.     }
  86.     public function setName(string $name): self
  87.     {
  88.         $this->name $name;
  89.         return $this;
  90.     }
  91.     public function getDescription(): ?string
  92.     {
  93.         return $this->description;
  94.     }
  95.     public function setDescription(?string $description): self
  96.     {
  97.         $this->description $description;
  98.         return $this;
  99.     }
  100.     public function getProject(): ?Project
  101.     {
  102.         return $this->project;
  103.     }
  104.     public function setProject(?Project $project): self
  105.     {
  106.         $this->project $project;
  107.         return $this;
  108.     }
  109.     public function getLastRevision(): ?\DateTimeInterface
  110.     {
  111.         return $this->last_revision;
  112.     }
  113.     public function setLastRevision(?\DateTimeInterface $last_revision): self
  114.     {
  115.         $this->last_revision $last_revision;
  116.         return $this;
  117.     }
  118.     public function getCreatedBy(): ?User
  119.     {
  120.         return $this->created_by;
  121.     }
  122.     public function setCreatedBy(?User $created_by): self
  123.     {
  124.         $this->created_by $created_by;
  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.     /**
  137.      * @return Collection|ProjectMilestoneStatus[]
  138.      */
  139.     public function getProjectMilestoneStatuses(): Collection
  140.     {
  141.         return $this->projectMilestoneStatuses;
  142.     }
  143.     public function addProjectMilestoneStatus(ProjectMilestoneStatus $projectMilestoneStatus): self
  144.     {
  145.         if (!$this->projectMilestoneStatuses->contains($projectMilestoneStatus)) {
  146.             $this->projectMilestoneStatuses[] = $projectMilestoneStatus;
  147.             $projectMilestoneStatus->setMilestone($this);
  148.         }
  149.         return $this;
  150.     }
  151.     public function removeProjectMilestoneStatus(ProjectMilestoneStatus $projectMilestoneStatus): self
  152.     {
  153.         if ($this->projectMilestoneStatuses->removeElement($projectMilestoneStatus)) {
  154.             // set the owning side to null (unless already changed)
  155.             if ($projectMilestoneStatus->getMilestone() === $this) {
  156.                 $projectMilestoneStatus->setMilestone(null);
  157.             }
  158.         }
  159.         return $this;
  160.     }
  161.     /**
  162.      * @return Collection|ProjectActivity[]
  163.      */
  164.     public function getProjectActivities(): Collection
  165.     {
  166.         return $this->projectActivities;
  167.     }
  168.     public function addProjectActivity(ProjectActivity $projectActivity): self
  169.     {
  170.         if (!$this->projectActivities->contains($projectActivity)) {
  171.             $this->projectActivities[] = $projectActivity;
  172.             $projectActivity->setMilestone($this);
  173.         }
  174.         return $this;
  175.     }
  176.     public function removeProjectActivity(ProjectActivity $projectActivity): self
  177.     {
  178.         if ($this->projectActivities->removeElement($projectActivity)) {
  179.             // set the owning side to null (unless already changed)
  180.             if ($projectActivity->getMilestone() === $this) {
  181.                 $projectActivity->setMilestone(null);
  182.             }
  183.         }
  184.         return $this;
  185.     }
  186.     public function __toString()
  187.     {
  188.         return $this->name;
  189.     }
  190.     public function getActivitiesEqualWeight(): ?bool
  191.     {
  192.         return $this->activities_equal_weight;
  193.     }
  194.     public function setActivitiesEqualWeight(bool $activities_equal_weight): self
  195.     {
  196.         $this->activities_equal_weight $activities_equal_weight;
  197.         return $this;
  198.     }
  199.     /**
  200.      * @return Collection|ProjectDeliverable[]
  201.      */
  202.     public function getProjectDeliverables(): Collection
  203.     {
  204.         return $this->projectDeliverables;
  205.     }
  206.     public function addProjectDeliverable(ProjectDeliverable $projectDeliverable): self
  207.     {
  208.         if (!$this->projectDeliverables->contains($projectDeliverable)) {
  209.             $this->projectDeliverables[] = $projectDeliverable;
  210.             $projectDeliverable->setMilestone($this);
  211.         }
  212.         return $this;
  213.     }
  214.     public function removeProjectDeliverable(ProjectDeliverable $projectDeliverable): self
  215.     {
  216.         if ($this->projectDeliverables->removeElement($projectDeliverable)) {
  217.             // set the owning side to null (unless already changed)
  218.             if ($projectDeliverable->getMilestone() === $this) {
  219.                 $projectDeliverable->setMilestone(null);
  220.             }
  221.         }
  222.         return $this;
  223.     }
  224.     public function getWeight(): ?int
  225.     {
  226.         return $this->weight;
  227.     }
  228.     public function setWeight(int $weight): self
  229.     {
  230.         $this->weight $weight;
  231.         return $this;
  232.     }
  233.     public function getStartDate(): ?\DateTimeInterface
  234.     {
  235.         return $this->start_date;
  236.     }
  237.     public function setStartDate(\DateTimeInterface $start_date): self
  238.     {
  239.         $this->start_date $start_date;
  240.         return $this;
  241.     }
  242.     public function getEndDate(): ?\DateTimeInterface
  243.     {
  244.         return $this->end_date;
  245.     }
  246.     public function setEndDate(\DateTimeInterface $end_date): self
  247.     {
  248.         $this->end_date $end_date;
  249.         return $this;
  250.     }
  251. }