src/Entity/SliderImages.php line 24

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\ActiveTrait;
  4. use App\Entity\Traits\DeleteTrait;
  5. use App\Entity\Traits\ImageUploadTrait;
  6. use App\Entity\Traits\LinkTrait;
  7. use App\Entity\Traits\MetaTrait;
  8. use App\Entity\Traits\TitleAndContentTrait;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Gedmo\Mapping\Annotation as Gedmo;
  11. use Gedmo\Timestampable\Traits\TimestampableEntity;
  12. /**
  13. * Slider.
  14. *
  15. * @Gedmo\Loggable
  16. *
  17. * @Gedmo\TranslationEntity(class="App\Entity\SliderImagesTranslations")
  18. */
  19. #[ORM\Entity(repositoryClass: \App\Repository\SliderRepository::class)]
  20. #[ORM\Table(name: 'slider_images')]
  21. class SliderImages
  22. {
  23. use TitleAndContentTrait;
  24. use LinkTrait;
  25. use MetaTrait;
  26. use ActiveTrait;
  27. use DeleteTrait;
  28. use ImageUploadTrait;
  29. use TimestampableEntity;
  30. public ?Slider $images = null;
  31. #[ORM\Column(name: 'id', type: 'integer')]
  32. #[ORM\Id]
  33. #[ORM\GeneratedValue(strategy: 'AUTO')]
  34. private int $id;
  35. /**
  36. * @Gedmo\Translatable
  37. */
  38. #[ORM\Column(name: 'html', type: 'text', length: 255, nullable: true)]
  39. private ?string $html = null;
  40. #[ORM\Column(name: 'position', type: 'integer', length: 2, nullable: false)]
  41. private ?int $position = null;
  42. /**
  43. * @Gedmo\Translatable
  44. */
  45. #[ORM\Column(name: 'link', type: 'string', length: 255, nullable: true)]
  46. private ?string $link = null;
  47. #[ORM\ManyToOne(targetEntity: 'Slider', inversedBy: 'images')]
  48. #[ORM\JoinColumn(name: 'slider_id', referencedColumnName: 'id')]
  49. private ?Slider $slider = null;
  50. #[ORM\Column(name: 'buttontext', type: 'string', length: 255, nullable: true)]
  51. private ?string $buttontext = null;
  52. /**
  53. * Get id.
  54. *
  55. * @return int
  56. */
  57. public function getId()
  58. {
  59. return $this->id;
  60. }
  61. /**
  62. * Set html.
  63. *
  64. * @param string $html
  65. *
  66. * @return SliderImages
  67. */
  68. public function setHtml($html)
  69. {
  70. $this->html = $html;
  71. return $this;
  72. }
  73. /**
  74. * Get html.
  75. *
  76. * @return string
  77. */
  78. public function getHtml()
  79. {
  80. return $this->html;
  81. }
  82. /**
  83. * Set link.
  84. *
  85. * @param string $link
  86. *
  87. * @return SliderImages
  88. */
  89. public function setLink($link)
  90. {
  91. $this->link = $link;
  92. return $this;
  93. }
  94. /**
  95. * Get link.
  96. *
  97. * @return string
  98. */
  99. public function getLink()
  100. {
  101. return $this->link;
  102. }
  103. /**
  104. * Set images.
  105. *
  106. * @return SliderImages
  107. */
  108. public function setImages(?Slider $images = null)
  109. {
  110. $this->images = $images;
  111. return $this;
  112. }
  113. /**
  114. * Get images.
  115. *
  116. * @return Slider
  117. */
  118. public function getImages()
  119. {
  120. return $this->images;
  121. }
  122. /**
  123. * Set position.
  124. *
  125. * @param int $position
  126. *
  127. * @return SliderImages
  128. */
  129. public function setPosition($position)
  130. {
  131. $this->position = $position;
  132. return $this;
  133. }
  134. /**
  135. * Get position.
  136. *
  137. * @return int
  138. */
  139. public function getPosition()
  140. {
  141. return $this->position;
  142. }
  143. /**
  144. * Set slider.
  145. *
  146. * @return SliderImages
  147. */
  148. public function setSlider(?Slider $slider = null)
  149. {
  150. $this->slider = $slider;
  151. return $this;
  152. }
  153. /**
  154. * Get slider.
  155. *
  156. * @return Slider
  157. */
  158. public function getSlider()
  159. {
  160. return $this->slider;
  161. }
  162. /**
  163. * Set buttontext.
  164. *
  165. * @param string $buttontext
  166. *
  167. * @return SliderImages
  168. */
  169. public function setButtontext($buttontext)
  170. {
  171. $this->buttontext = $buttontext;
  172. return $this;
  173. }
  174. /**
  175. * Get buttontext.
  176. *
  177. * @return string
  178. */
  179. public function getButtontext()
  180. {
  181. return $this->buttontext;
  182. }
  183. // REQUIRED BY THE META LINKS TRAIT - NOT REALLY NEEDED HERE BUT WHATEVS :)
  184. public function getLinkedPageId(): int
  185. {
  186. return 1;
  187. }
  188. }