src/Entity/CommentProject2.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CommentProject2Repository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=CommentProject2Repository::class)
  9.  */
  10. class CommentProject2
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="text",  nullable=true)
  20.      */
  21.     private $comment;
  22.     /**
  23.      * @ORM\Column(type="datetime", nullable=true)
  24.      */
  25.     private $createdAt;
  26.     /**
  27.      * @ORM\Column(type="datetime", nullable=true)
  28.      */
  29.     private $updateAt;
  30.     /**
  31.      * @ORM\ManyToOne(targetEntity="User", cascade={"persist"})
  32.      * @ORM\JoinColumn(name="user_id", referencedColumnName="id",nullable=true)
  33.      */
  34.     private $user;
  35.     /**
  36.      * @ORM\ManyToOne(targetEntity="Project", cascade={"persist"}, inversedBy="commentProject2")
  37.      * @ORM\JoinColumn(name="project_id", referencedColumnName="id",nullable=true)
  38.      */
  39.     private $project;
  40.     /**
  41.      * @ORM\OneToMany(targetEntity="CommentProject2Child", cascade={"persist"},mappedBy="commentProject2",orphanRemoval=true)
  42.      */
  43.     private $commentProject2Child;
  44.     public function __construct()
  45.     {
  46.         $this->createdAt = new \DateTime();
  47.         $this->commentProject2Child = new ArrayCollection();
  48.     }
  49.     public function getId(): ?int
  50.     {
  51.         return $this->id;
  52.     }
  53.     public function getComment(): ?string
  54.     {
  55.         return $this->comment;
  56.     }
  57.     public function setComment(?string $comment): self
  58.     {
  59.         $this->comment = $comment;
  60.         return $this;
  61.     }
  62.     public function getCreatedAt(): ?\DateTimeInterface
  63.     {
  64.         return $this->createdAt;
  65.     }
  66.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  67.     {
  68.         $this->createdAt = $createdAt;
  69.         return $this;
  70.     }
  71.     public function getUser(): ?User
  72.     {
  73.         return $this->user;
  74.     }
  75.     public function setUser(?User $user): self
  76.     {
  77.         $this->user = $user;
  78.         return $this;
  79.     }
  80.     public function getProject(): ?Project
  81.     {
  82.         return $this->project;
  83.     }
  84.     public function setProject(?Project $project): self
  85.     {
  86.         $this->project = $project;
  87.         return $this;
  88.     }
  89.     public function getUpdateAt(): ?\DateTimeInterface
  90.     {
  91.         return $this->updateAt;
  92.     }
  93.     public function setUpdateAt(?\DateTimeInterface $updateAt): self
  94.     {
  95.         $this->updateAt = $updateAt;
  96.         return $this;
  97.     }
  98.     /**
  99.      * @return Collection|CommentProject2Child[]
  100.      */
  101.     public function getCommentProject2Child(): Collection
  102.     {
  103.         return $this->commentProject2Child;
  104.     }
  105.     public function addCommentProject2Child(CommentProject2Child $commentProject2Child): self
  106.     {
  107.         if (!$this->commentProject2Child->contains($commentProject2Child)) {
  108.             $this->commentProject2Child[] = $commentProject2Child;
  109.             $commentProject2Child->setCommentProject2($this);
  110.         }
  111.         return $this;
  112.     }
  113.     public function removeCommentProject2Child(CommentProject2Child $commentProject2Child): self
  114.     {
  115.         if ($this->commentProject2Child->removeElement($commentProject2Child)) {
  116.             // set the owning side to null (unless already changed)
  117.             if ($commentProject2Child->getCommentProject2() === $this) {
  118.                 $commentProject2Child->setCommentProject2(null);
  119.             }
  120.         }
  121.         return $this;
  122.     }
  123. }