Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\Entity;
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\Common\Collections\Collection;
- use Doctrine\Common\Collections\Criteria;
- use Doctrine\ORM\Mapping as ORM;
- /**
- * @ORM\Entity(repositoryClass="App\Repository\ForumForumRepository")
- */
- class ForumForum
- {
- /**
- * @ORM\Id()
- * @ORM\GeneratedValue()
- * @ORM\Column(type="integer")
- */
- private $id;
- /**
- * @ORM\Column(type="string", length=255)
- */
- private $title;
- /**
- * @ORM\Column(type="integer")
- */
- private $pos;
- /**
- * @ORM\Column(type="string", length=255, nullable=true)
- */
- private $description;
- /**
- * @ORM\ManyToOne(targetEntity="App\Entity\forumCat", inversedBy="forumForums")
- * @ORM\JoinColumn(nullable=false)
- */
- private $cat;
- /**
- * @ORM\OneToMany(targetEntity="App\Entity\ForumTopics", mappedBy="forum")
- */
- private $forumTopics;
- public function __construct()
- {
- $this->forumTopics = new ArrayCollection();
- }
- public function getId()
- {
- return $this->id;
- }
- public function getTitle(): ?string
- {
- return $this->title;
- }
- public function setTitle(string $title): self
- {
- $this->title = $title;
- return $this;
- }
- public function getPos(): ?int
- {
- return $this->pos;
- }
- public function setPos(int $pos): self
- {
- $this->pos = $pos;
- return $this;
- }
- public function getDescription(): ?string
- {
- return $this->description;
- }
- public function setDescription(?string $description): self
- {
- $this->description = $description;
- return $this;
- }
- public function getCat(): ?forumCat
- {
- return $this->cat;
- }
- public function setCat(?forumCat $cat): self
- {
- $this->cat = $cat;
- return $this;
- }
- // public function getLastTopic()
- // {
- // return $this->forumTopics->matching($criteria);
- // }
- /**
- * @return Collection|ForumTopics[]
- */
- public function getForumTopics(): Collection
- {
- return $this->forumTopics;
- }
- public function addForumTopic(ForumTopics $forumTopic): self
- {
- if (!$this->forumTopics->contains($forumTopic)) {
- $this->forumTopics[] = $forumTopic;
- $forumTopic->setForum($this);
- }
- return $this;
- }
- public function removeForumTopic(ForumTopics $forumTopic): self
- {
- if ($this->forumTopics->contains($forumTopic)) {
- $this->forumTopics->removeElement($forumTopic);
- // set the owning side to null (unless already changed)
- if ($forumTopic->getForum() === $this) {
- $forumTopic->setForum(null);
- }
- }
- return $this;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement