src/AdminBundle/Entity/Objectives.php line 13

Open in your IDE?
  1. <?php
  2. namespace AdminBundle\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * Objectives
  7. */
  8. #[ORM\Table(name: 'objectives')]
  9. #[ORM\Entity(repositoryClass: \AdminBundle\Repository\ObjectivesRepository::class)]
  10. class Objectives
  11. {
  12. /**
  13. * @var int
  14. */
  15. #[ORM\Column(name: 'id', type: 'integer')]
  16. #[ORM\Id]
  17. #[ORM\GeneratedValue(strategy: 'AUTO')]
  18. private $id;
  19. /**
  20. * @var string
  21. */
  22. #[ORM\Column(name: 'title', type: 'string', length: 255)]
  23. private $title;
  24. /**
  25. * @var string
  26. */
  27. #[ORM\Column(name: 'description', type: 'text', length: 4294967295, nullable: true)]
  28. private $description;
  29. /**
  30. * @var float
  31. */
  32. #[ORM\Column(name: 'price', type: 'float', scale: 2, nullable: true)]
  33. private $price;
  34. /**
  35. * @var string
  36. */
  37. #[ORM\Column(name: 'important_details', type: 'text', length: 4294967295, nullable: true)]
  38. private $importantDetails;
  39. #[ORM\OneToMany(targetEntity: \Images::class, mappedBy: 'objectives')]
  40. private $images;
  41. #[ORM\ManyToMany(targetEntity: \Tours::class, mappedBy: 'objectives', cascade: ['persist', 'remove'])]
  42. private $tours;
  43. /**
  44. * Constructor
  45. */
  46. public function __construct()
  47. {
  48. $this->images = new ArrayCollection();
  49. $this->tours = new ArrayCollection();
  50. }
  51. public function __toString() {
  52. return $this->getId() ? $this->getTitle() : 'n\a';
  53. }
  54. /**
  55. * Get id
  56. *
  57. * @return int
  58. */
  59. public function getId()
  60. {
  61. return $this->id;
  62. }
  63. /**
  64. * Set title
  65. *
  66. * @param string $title
  67. *
  68. * @return Objectives
  69. */
  70. public function setTitle($title)
  71. {
  72. $this->title = $title;
  73. return $this;
  74. }
  75. /**
  76. * Get title
  77. *
  78. * @return string
  79. */
  80. public function getTitle()
  81. {
  82. return $this->title;
  83. }
  84. /**
  85. * Set description
  86. *
  87. * @param string $description
  88. *
  89. * @return Objectives
  90. */
  91. public function setDescription($description)
  92. {
  93. $this->description = $description;
  94. return $this;
  95. }
  96. /**
  97. * Get description
  98. *
  99. * @return string
  100. */
  101. public function getDescription()
  102. {
  103. return $this->description;
  104. }
  105. /**
  106. * Set importantDetails
  107. *
  108. * @param string $importantDetails
  109. *
  110. * @return Objectives
  111. */
  112. public function setImportantDetails($importantDetails)
  113. {
  114. $this->importantDetails = $importantDetails;
  115. return $this;
  116. }
  117. /**
  118. * Get importantDetails
  119. *
  120. * @return string
  121. */
  122. public function getImportantDetails()
  123. {
  124. return $this->importantDetails;
  125. }
  126. /**
  127. * Add image
  128. *
  129. * @param \AdminBundle\Entity\Images $image
  130. *
  131. * @return Objectives
  132. */
  133. public function addImage(Images $image)
  134. {
  135. $this->images[] = $image;
  136. return $this;
  137. }
  138. /**
  139. * Remove image
  140. *
  141. * @param \AdminBundle\Entity\Images $image
  142. */
  143. public function removeImage(Images $image)
  144. {
  145. $this->images->removeElement($image);
  146. }
  147. /**
  148. * Get images
  149. *
  150. * @return \Doctrine\Common\Collections\Collection
  151. */
  152. public function getImages()
  153. {
  154. return $this->images;
  155. }
  156. /**
  157. * Add tour
  158. *
  159. * @param \AdminBundle\Entity\Tours $tour
  160. *
  161. * @return Objectives
  162. */
  163. public function addTour(Tours $tour)
  164. {
  165. $this->tours[] = $tour;
  166. return $this;
  167. }
  168. /**
  169. * Remove tour
  170. *
  171. * @param \AdminBundle\Entity\Objectives $tour
  172. */
  173. public function removeTour(Objectives $tour)
  174. {
  175. $this->tours->removeElement($tour);
  176. }
  177. /**
  178. * Get tour
  179. *
  180. * @return \Doctrine\Common\Collections\Collection
  181. */
  182. public function getTours()
  183. {
  184. return $this->tours;
  185. }
  186. /**
  187. * @return float
  188. */
  189. public function getPrice()
  190. {
  191. return $this->price;
  192. }
  193. /**
  194. * @param float $price
  195. */
  196. public function setPrice($price)
  197. {
  198. $this->price = $price;
  199. }
  200. }