Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace AppBundle\Entity;
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\ORM\Mapping as ORM;
- /**
- * Task
- *
- * @ORM\Table(name="task")
- * @ORM\Entity(repositoryClass="AppBundle\Repository\TaskRepository")
- */
- class Task
- {
- /**
- * @var int
- *
- * @ORM\Column(name="id", type="integer")
- * @ORM\Id
- * @ORM\GeneratedValue(strategy="AUTO")
- */
- private $id;
- /**
- * @var string
- *
- * @ORM\Column(name="description", type="string", length=255)
- */
- private $description;
- /**
- * @var ArrayCollection
- * @ORM\OneToMany(targetEntity="AppBundle\Entity\Tag", mappedBy="task")
- */
- private $tags;
- public function __construct()
- {
- $this->tags = new ArrayCollection();
- }
- /**
- * Get id
- *
- * @return int
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Set description
- *
- * @param string $description
- *
- * @return Task
- */
- public function setDescription($description)
- {
- $this->description = $description;
- return $this;
- }
- /**
- * Get description
- *
- * @return string
- */
- public function getDescription()
- {
- return $this->description;
- }
- /**
- * Add tag
- *
- * @param \AppBundle\Entity\Tag $tag
- *
- * @return Task
- */
- public function addTag(\AppBundle\Entity\Tag $tag)
- {
- $this->tags[] = $tag;
- return $this;
- }
- /**
- * Remove tag
- *
- * @param \AppBundle\Entity\Tag $tag
- */
- public function removeTag(\AppBundle\Entity\Tag $tag)
- {
- $this->tags->removeElement($tag);
- }
- /**
- * Get tags
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getTags()
- {
- return $this->tags;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement