src/Entity/ProjectCollaborationTopic.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProjectCollaborationTopicRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ProjectCollaborationTopicRepository::class)
  9.  */
  10. class ProjectCollaborationTopic
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity=Project::class, inversedBy="projectCollaborationTopics")
  20.      * @ORM\JoinColumn(nullable=false)
  21.      */
  22.     private $project;
  23.     /**
  24.      * @ORM\Column(type="string", length=255)
  25.      */
  26.     private $title;
  27.     /**
  28.      * @ORM\Column(type="text", nullable=true)
  29.      */
  30.     private $description;
  31.     /**
  32.      * @ORM\ManyToOne(targetEntity=User::class)
  33.      * @ORM\JoinColumn(nullable=false)
  34.      */
  35.     private $created_by;
  36.     /**
  37.      * @ORM\Column(type="datetime")
  38.      */
  39.     private $created_at;
  40.     /**
  41.      * @ORM\OneToMany(targetEntity=ActivityChat::class, mappedBy="topic")
  42.      */
  43.     private $activityChats;
  44.     public function __construct()
  45.     {
  46.         $this->activityChats = new ArrayCollection();
  47.     }
  48.     public function getId(): ?int
  49.     {
  50.         return $this->id;
  51.     }
  52.     public function getProject(): ?Project
  53.     {
  54.         return $this->project;
  55.     }
  56.     public function setProject(?Project $project): self
  57.     {
  58.         $this->project $project;
  59.         return $this;
  60.     }
  61.     public function getTitle(): ?string
  62.     {
  63.         return $this->title;
  64.     }
  65.     public function setTitle(string $title): self
  66.     {
  67.         $this->title $title;
  68.         return $this;
  69.     }
  70.     public function getDescription(): ?string
  71.     {
  72.         return $this->description;
  73.     }
  74.     public function setDescription(?string $description): self
  75.     {
  76.         $this->description $description;
  77.         return $this;
  78.     }
  79.     public function getCreatedBy(): ?User
  80.     {
  81.         return $this->created_by;
  82.     }
  83.     public function setCreatedBy(?User $created_by): self
  84.     {
  85.         $this->created_by $created_by;
  86.         return $this;
  87.     }
  88.     public function getCreatedAt(): ?\DateTimeInterface
  89.     {
  90.         return $this->created_at;
  91.     }
  92.     public function setCreatedAt(\DateTimeInterface $created_at): self
  93.     {
  94.         $this->created_at $created_at;
  95.         return $this;
  96.     }
  97.     /**
  98.      * @return Collection|ActivityChat[]
  99.      */
  100.     public function getActivityChats(): Collection
  101.     {
  102.         return $this->activityChats;
  103.     }
  104.     public function addActivityChat(ActivityChat $activityChat): self
  105.     {
  106.         if (!$this->activityChats->contains($activityChat)) {
  107.             $this->activityChats[] = $activityChat;
  108.             $activityChat->setTopic($this);
  109.         }
  110.         return $this;
  111.     }
  112.     public function removeActivityChat(ActivityChat $activityChat): self
  113.     {
  114.         if ($this->activityChats->removeElement($activityChat)) {
  115.             // set the owning side to null (unless already changed)
  116.             if ($activityChat->getTopic() === $this) {
  117.                 $activityChat->setTopic(null);
  118.             }
  119.         }
  120.         return $this;
  121.     }
  122.     public function __toString()
  123.     {
  124.         return $this->title;
  125.     }
  126. }