src/Entity/System/ProductImage.php line 27

Open in your IDE?
  1. <?php
  2. namespace App\Entity\System;
  3. use Doctrine\Common\Collections\Collection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * Product
  7. *
  8. * @ORM\Table(name="ps_image",
  9. * uniqueConstraints={
  10. *
  11. * @ORM\UniqueConstraint(name="uk_product_image", columns={"id_image", "id_product", "cover"})
  12. * },
  13. * indexes={
  14. *
  15. * @ORM\Index(name="active", columns={"active"}),
  16. * @ORM\Index(name="id_product_cover", columns={"id_product", "cover"}),
  17. * @ORM\Index(name="is_gif", columns={"is_gif"}),
  18. * @ORM\Index(name="position", columns={"position"})
  19. * }
  20. * )
  21. *
  22. * @ORM\Entity(repositoryClass="App\Repository\System\ProductImageRepository")
  23. */
  24. class ProductImage
  25. {
  26. public const JPG_EXTENSION_VALUE = '.jpg';
  27. public const GIF_EXTENSION_VALUE = '.gif';
  28. /**
  29. * @ORM\Column(name="id_image", type="integer")
  30. *
  31. * @ORM\Id
  32. *
  33. * @ORM\GeneratedValue(strategy="AUTO")
  34. */
  35. private int $id;
  36. /**
  37. * @ORM\ManyToOne(targetEntity="Product", inversedBy="productImages")
  38. *
  39. * @ORM\JoinColumn(name="id_product", referencedColumnName="id_product", nullable=false)
  40. */
  41. private Product $product;
  42. /**
  43. * @var Collection<int, Taxonomy>|Taxonomy[]
  44. *
  45. * @ORM\OneToMany(targetEntity="App\Entity\System\Taxonomy", mappedBy="image")
  46. */
  47. private $taxonomies;
  48. /**
  49. * @ORM\Column(name="position", type="integer", options={"default" : 0})
  50. */
  51. private int $position;
  52. /**
  53. * @ORM\Column(name="cover", type="boolean", options={"default" : 0})
  54. */
  55. private bool $cover;
  56. /**
  57. * @var string|null
  58. *
  59. * @ORM\Column(name="name", type="string", length=128, nullable=true)
  60. */
  61. private ?string $name;
  62. /**
  63. * @ORM\Column(name="is_gif", type="boolean", options={"default" : 0})
  64. */
  65. private ?bool $isGif;
  66. /**
  67. * @ORM\Column(name="active", type="boolean", options={"default" : 1})
  68. */
  69. private bool $active;
  70. /**
  71. * @ORM\Column(name="is_background_white", type="boolean", nullable=true)
  72. */
  73. private ?bool $isBackgroundWhite;
  74. /**
  75. * @ORM\Column(name="is_brand", type="boolean", nullable=true)
  76. */
  77. private ?bool $isBrand;
  78. /**
  79. * @ORM\Column(name="is_energy_efficiency", type="boolean", nullable=true)
  80. */
  81. private ?bool $isEnergyEfficiency;
  82. /**
  83. * @ORM\Column(name="is_horizontal", type="boolean", nullable=true)
  84. */
  85. private ?bool $isHorizontal;
  86. /**
  87. * @ORM\Column(name="is_icon", type="boolean", nullable=true)
  88. */
  89. private ?bool $isIcon;
  90. /**
  91. * @ORM\Column(name="is_logo", type="boolean", nullable=true)
  92. */
  93. private ?bool $isLogo;
  94. /**
  95. * @ORM\Column(name="is_marketing_photo", type="boolean", nullable=true)
  96. */
  97. private ?bool $isMarketingPhoto;
  98. /**
  99. * @ORM\Column(name="is_packaging_photo", type="boolean", nullable=true)
  100. */
  101. private ?bool $isPackagingPhoto;
  102. /**
  103. * @ORM\Column(name="has_measures", type="boolean", nullable=true)
  104. */
  105. private ?bool $hasMeasures;
  106. /**
  107. * @ORM\Column(name="gpsr_label", type="boolean", options={"default"=0})
  108. */
  109. private bool $gpsrLabel;
  110. /**
  111. * @ORM\Column(name="gpsr_warning", type="boolean", options={"default"=0})
  112. */
  113. private bool $gpsrWarning;
  114. /**
  115. * @return int
  116. */
  117. public function getId(): int
  118. {
  119. return $this->id;
  120. }
  121. public function getProduct(): Product
  122. {
  123. return $this->product;
  124. }
  125. /**
  126. * @param Product $product
  127. *
  128. * @return ProductImage
  129. */
  130. public function setProduct(Product $product): ProductImage
  131. {
  132. $this->product = $product;
  133. return $this;
  134. }
  135. /**
  136. * @return int
  137. */
  138. public function getPosition(): int
  139. {
  140. return $this->position;
  141. }
  142. /**
  143. * @param int $position
  144. *
  145. * @return ProductImage
  146. */
  147. public function setPosition(int $position): ProductImage
  148. {
  149. $this->position = $position;
  150. return $this;
  151. }
  152. /**
  153. * @return bool
  154. */
  155. public function isCover(): bool
  156. {
  157. return $this->cover;
  158. }
  159. /**
  160. * @param bool $cover
  161. *
  162. * @return ProductImage
  163. */
  164. public function setCover(bool $cover): ProductImage
  165. {
  166. $this->cover = $cover;
  167. return $this;
  168. }
  169. /**
  170. * @return string|null
  171. */
  172. public function getName(): ?string
  173. {
  174. return $this->name;
  175. }
  176. /**
  177. * @param string|null $name
  178. *
  179. * @return ProductImage
  180. */
  181. public function setName(?string $name): ProductImage
  182. {
  183. $this->name = $name;
  184. return $this;
  185. }
  186. /**
  187. * @return bool|null
  188. */
  189. public function isGif(): ?bool
  190. {
  191. return $this->isGif;
  192. }
  193. /**
  194. * @param bool|null $isGif
  195. *
  196. * @return ProductImage
  197. */
  198. public function setIsGif(?bool $isGif): ProductImage
  199. {
  200. $this->isGif = $isGif;
  201. return $this;
  202. }
  203. /**
  204. * @return bool
  205. */
  206. public function isActive(): bool
  207. {
  208. return $this->active;
  209. }
  210. /**
  211. * @param bool $active
  212. *
  213. * @return ProductImage
  214. */
  215. public function setActive(bool $active): ProductImage
  216. {
  217. $this->active = $active;
  218. return $this;
  219. }
  220. public function isBackgroundWhite(): ?bool
  221. {
  222. return $this->isBackgroundWhite;
  223. }
  224. public function setIsBackgroundWhite(?bool $isBackgroundWhite): ProductImage
  225. {
  226. $this->isBackgroundWhite = $isBackgroundWhite;
  227. return $this;
  228. }
  229. public function isBrand(): ?bool
  230. {
  231. return $this->isBrand;
  232. }
  233. public function setIsBrand(?bool $isBrand): ProductImage
  234. {
  235. $this->isBrand = $isBrand;
  236. return $this;
  237. }
  238. public function isEnergyEfficiency(): ?bool
  239. {
  240. return $this->isEnergyEfficiency;
  241. }
  242. public function setIsEnergyEfficiency(?bool $isEnergyEfficiency): ProductImage
  243. {
  244. $this->isEnergyEfficiency = $isEnergyEfficiency;
  245. return $this;
  246. }
  247. public function isHorizontal(): ?bool
  248. {
  249. return $this->isHorizontal;
  250. }
  251. public function setIsHorizontal(?bool $isHorizontal): ProductImage
  252. {
  253. $this->isHorizontal = $isHorizontal;
  254. return $this;
  255. }
  256. public function isIcon(): ?bool
  257. {
  258. return $this->isIcon;
  259. }
  260. public function setIsIcon(?bool $isIcon): ProductImage
  261. {
  262. $this->isIcon = $isIcon;
  263. return $this;
  264. }
  265. public function isLogo(): ?bool
  266. {
  267. return $this->isLogo;
  268. }
  269. public function setIsLogo(?bool $isLogo): ProductImage
  270. {
  271. $this->isLogo = $isLogo;
  272. return $this;
  273. }
  274. public function isMarketingPhoto(): ?bool
  275. {
  276. return $this->isMarketingPhoto;
  277. }
  278. public function setIsMarketingPhoto(?bool $isMarketingPhoto): ProductImage
  279. {
  280. $this->isMarketingPhoto = $isMarketingPhoto;
  281. return $this;
  282. }
  283. public function isPackagingPhoto(): ?bool
  284. {
  285. return $this->isPackagingPhoto;
  286. }
  287. public function setIsPackagingPhoto(?bool $isPackagingPhoto): ProductImage
  288. {
  289. $this->isPackagingPhoto = $isPackagingPhoto;
  290. return $this;
  291. }
  292. public function getHasMeasures(): ?bool
  293. {
  294. return $this->hasMeasures;
  295. }
  296. public function setHasMeasures(?bool $hasMeasures): ProductImage
  297. {
  298. $this->hasMeasures = $hasMeasures;
  299. return $this;
  300. }
  301. public function isGpsrLabel(): bool
  302. {
  303. return $this->gpsrLabel;
  304. }
  305. public function setGpsrLabel(bool $gpsrLabel): ProductImage
  306. {
  307. $this->gpsrLabel = $gpsrLabel;
  308. return $this;
  309. }
  310. public function isGpsrWarning(): bool
  311. {
  312. return $this->gpsrWarning;
  313. }
  314. public function setGpsrWarning(bool $gpsrWarning): ProductImage
  315. {
  316. $this->gpsrWarning = $gpsrWarning;
  317. return $this;
  318. }
  319. /**
  320. * @return Collection<int, Taxonomy>|Taxonomy[]
  321. */
  322. public function getTaxonomies()
  323. {
  324. return $this->taxonomies;
  325. }
  326. /**
  327. * @param Collection<int, Taxonomy>|Taxonomy[] $taxonomies
  328. *
  329. * @return ProductImage
  330. */
  331. public function setTaxonomies($taxonomies)
  332. {
  333. $this->taxonomies = $taxonomies;
  334. return $this;
  335. }
  336. }