Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. <?php
  2.  
  3. namespace AppBundle\Entity;
  4.  
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\ORM\Mapping as ORM;
  7.  
  8. /**
  9. * Task
  10. *
  11. * @ORM\Table(name="task")
  12. * @ORM\Entity(repositoryClass="AppBundle\Repository\TaskRepository")
  13. */
  14. class Task
  15. {
  16. /**
  17. * @var int
  18. *
  19. * @ORM\Column(name="id", type="integer")
  20. * @ORM\Id
  21. * @ORM\GeneratedValue(strategy="AUTO")
  22. */
  23. private $id;
  24.  
  25. /**
  26. * @var string
  27. *
  28. * @ORM\Column(name="description", type="string", length=255)
  29. */
  30. private $description;
  31.  
  32. /**
  33. * @var ArrayCollection
  34. * @ORM\OneToMany(targetEntity="AppBundle\Entity\Tag", mappedBy="task")
  35. */
  36. private $tags;
  37.  
  38. public function __construct()
  39. {
  40. $this->tags = new ArrayCollection();
  41. }
  42.  
  43. /**
  44. * Get id
  45. *
  46. * @return int
  47. */
  48. public function getId()
  49. {
  50. return $this->id;
  51. }
  52.  
  53. /**
  54. * Set description
  55. *
  56. * @param string $description
  57. *
  58. * @return Task
  59. */
  60. public function setDescription($description)
  61. {
  62. $this->description = $description;
  63.  
  64. return $this;
  65. }
  66.  
  67. /**
  68. * Get description
  69. *
  70. * @return string
  71. */
  72. public function getDescription()
  73. {
  74. return $this->description;
  75. }
  76.  
  77. /**
  78. * Add tag
  79. *
  80. * @param \AppBundle\Entity\Tag $tag
  81. *
  82. * @return Task
  83. */
  84. public function addTag(\AppBundle\Entity\Tag $tag)
  85. {
  86. $this->tags[] = $tag;
  87.  
  88. return $this;
  89. }
  90.  
  91. /**
  92. * Remove tag
  93. *
  94. * @param \AppBundle\Entity\Tag $tag
  95. */
  96. public function removeTag(\AppBundle\Entity\Tag $tag)
  97. {
  98. $this->tags->removeElement($tag);
  99. }
  100.  
  101. /**
  102. * Get tags
  103. *
  104. * @return \Doctrine\Common\Collections\Collection
  105. */
  106. public function getTags()
  107. {
  108. return $this->tags;
  109. }
  110.  
  111. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement