src/Entity/ProjectStructure.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProjectStructureRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ProjectStructureRepository::class)
  9.  */
  10. class ProjectStructure
  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="projectStructures")
  28.      * @ORM\JoinColumn(nullable=false)
  29.      */
  30.     private $project;
  31.     /**
  32.      * @ORM\ManyToOne(targetEntity=ProjectStructure::class)
  33.      */
  34.     private $reports_to;
  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\ManyToMany(targetEntity=EmailTemplate::class, inversedBy="projectStructures")
  46.      */
  47.     private $email_template;
  48.     /**
  49.      * @ORM\OneToMany(targetEntity=ProjectMembers::class, mappedBy="role")
  50.      */
  51.     private $projectMembers;
  52.     /**
  53.      * @ORM\Column(type="boolean")
  54.      */
  55.     private $one_person_only;
  56.     public function __construct()
  57.     {
  58.         $this->email_template = new ArrayCollection();
  59.         $this->projectMembers = new ArrayCollection();
  60.     }
  61.     public function getId(): ?int
  62.     {
  63.         return $this->id;
  64.     }
  65.     public function getName(): ?string
  66.     {
  67.         return $this->name;
  68.     }
  69.     public function setName(string $name): self
  70.     {
  71.         $this->name $name;
  72.         return $this;
  73.     }
  74.     public function getDescription(): ?string
  75.     {
  76.         return $this->description;
  77.     }
  78.     public function setDescription(?string $description): self
  79.     {
  80.         $this->description $description;
  81.         return $this;
  82.     }
  83.     public function getProject(): ?Project
  84.     {
  85.         return $this->project;
  86.     }
  87.     public function setProject(?Project $project): self
  88.     {
  89.         $this->project $project;
  90.         return $this;
  91.     }
  92.     public function getReportsTo(): ?self
  93.     {
  94.         return $this->reports_to;
  95.     }
  96.     public function setReportsTo(?self $reports_to): self
  97.     {
  98.         $this->reports_to $reports_to;
  99.         return $this;
  100.     }
  101.     public function getCreatedBy(): ?User
  102.     {
  103.         return $this->created_by;
  104.     }
  105.     public function setCreatedBy(?User $created_by): self
  106.     {
  107.         $this->created_by $created_by;
  108.         return $this;
  109.     }
  110.     public function getCreatedAt(): ?\DateTimeInterface
  111.     {
  112.         return $this->created_at;
  113.     }
  114.     public function setCreatedAt(\DateTimeInterface $created_at): self
  115.     {
  116.         $this->created_at $created_at;
  117.         return $this;
  118.     }
  119.     /**
  120.      * @return Collection|EmailTemplate[]
  121.      */
  122.     public function getEmailTemplate(): Collection
  123.     {
  124.         return $this->email_template;
  125.     }
  126.     public function addEmailTemplate(EmailTemplate $emailTemplate): self
  127.     {
  128.         if (!$this->email_template->contains($emailTemplate)) {
  129.             $this->email_template[] = $emailTemplate;
  130.         }
  131.         return $this;
  132.     }
  133.     public function removeEmailTemplate(EmailTemplate $emailTemplate): self
  134.     {
  135.         $this->email_template->removeElement($emailTemplate);
  136.         return $this;
  137.     }
  138.     public function __toString()
  139.     {
  140.         return $this->name;
  141.     }
  142.     /**
  143.      * @return Collection|ProjectMembers[]
  144.      */
  145.     public function getProjectMembers(): Collection
  146.     {
  147.         return $this->projectMembers;
  148.     }
  149.     public function addProjectMember(ProjectMembers $projectMember): self
  150.     {
  151.         if (!$this->projectMembers->contains($projectMember)) {
  152.             $this->projectMembers[] = $projectMember;
  153.             $projectMember->setRole($this);
  154.         }
  155.         return $this;
  156.     }
  157.     public function removeProjectMember(ProjectMembers $projectMember): self
  158.     {
  159.         if ($this->projectMembers->removeElement($projectMember)) {
  160.             // set the owning side to null (unless already changed)
  161.             if ($projectMember->getRole() === $this) {
  162.                 $projectMember->setRole(null);
  163.             }
  164.         }
  165.         return $this;
  166.     }
  167.     public function getOnePersonOnly(): ?bool
  168.     {
  169.         return $this->one_person_only;
  170.     }
  171.     public function setOnePersonOnly(bool $one_person_only): self
  172.     {
  173.         $this->one_person_only $one_person_only;
  174.         return $this;
  175.     }
  176. }