src/Entity/Catalogue.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CatalogueRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8. * @ORM\Entity(repositoryClass=CatalogueRepository::class)
  9. */
  10. class Catalogue
  11. {
  12. public const CATALOGUE_TYPE_OBJPUB = 'obj_pub';
  13. public const CATALOGUE_TYPE_SHOPPING = 'shopping';
  14. public const CATALOGUE_TYPE_CUSTOMER = 'customer';
  15. public const CATALOGUE_TYPE_EVASION = 'evasion';
  16. public const CATALOGUE_TYPE_GIFT_CERTIFICATE = 'gift_certificate';
  17. /**
  18. * @ORM\Id
  19. * @ORM\GeneratedValue
  20. * @ORM\Column(type="integer")
  21. */
  22. private $id;
  23. /**
  24. * @ORM\Column(type="string", nullable=true)
  25. */
  26. private $slug;
  27. /**
  28. * @ORM\ManyToOne(targetEntity=Setting::class, inversedBy="catalogues")
  29. * @ORM\JoinColumn(nullable=false)
  30. */
  31. private $settingCatalogue;
  32. /**
  33. * @ORM\Column(type="string", length=255)
  34. */
  35. private $label;
  36. /**
  37. * @ORM\Column(type="boolean")
  38. */
  39. private $enabled;
  40. /**
  41. * @ORM\Column(type="boolean")
  42. */
  43. private $standAlone;
  44. /**
  45. * @ORM\Column(type="text")
  46. */
  47. private $types;
  48. /**
  49. * @ORM\Column(type="text")
  50. */
  51. private $campaigns;
  52. /**
  53. * @ORM\Column(type="text", nullable=true)
  54. */
  55. private $alertStock;
  56. /**
  57. * @ORM\Column(type="text", nullable=true)
  58. */
  59. private $include;
  60. /**
  61. * @ORM\Column(type="text", nullable=true)
  62. */
  63. private $filters;
  64. /**
  65. * @ORM\Column(type="boolean")
  66. */
  67. private $enabledResetFilters;
  68. /**
  69. * @ORM\Column(type="text", nullable=true)
  70. */
  71. private $fees;
  72. /**
  73. * @ORM\Column(type="text", nullable=true)
  74. */
  75. private $sorts;
  76. /**
  77. * @ORM\OneToMany(targetEntity=Slider::class, mappedBy="catalog")
  78. * @ORM\JoinColumn(nullable=true)
  79. */
  80. private $sliders;
  81. /**
  82. * @ORM\Column(type="boolean")
  83. */
  84. private $canOrder;
  85. /**
  86. * @ORM\Column(type="text", nullable=true)
  87. */
  88. private $hideFilters;
  89. /**
  90. * @ORM\Column(type="text", nullable=true)
  91. */
  92. private $specificExclusion;
  93. /**
  94. * @ORM\Column(type="boolean")
  95. */
  96. private bool $displayIfNoStock = false;
  97. /**
  98. * @ORM\Column(type="boolean")
  99. */
  100. private bool $displayIfPriceZero = false;
  101. /**
  102. * @ORM\Column(type="boolean")
  103. */
  104. private bool $isFilteredByParentBOCategory = true;
  105. /**
  106. * @ORM\Column(type="integer", options={"default": 99})
  107. */
  108. private $orderItem;
  109. public function __construct()
  110. {
  111. $this->sliders = new ArrayCollection();
  112. }
  113. public function __toString(): string
  114. {
  115. return $this->getSlug();
  116. }
  117. public function getId(): ?int
  118. {
  119. return $this->id;
  120. }
  121. public function getSlug(): ?string
  122. {
  123. return $this->slug;
  124. }
  125. public function setSlug( ?string $slug ): self
  126. {
  127. $this->slug = $slug;
  128. return $this;
  129. }
  130. public function getSettingCatalogue(): ?Setting
  131. {
  132. return $this->settingCatalogue;
  133. }
  134. public function setSettingCatalogue( ?Setting $settingCatalogue ): self
  135. {
  136. $this->settingCatalogue = $settingCatalogue;
  137. return $this;
  138. }
  139. /**
  140. * @return mixed
  141. */
  142. public function getLabel()
  143. {
  144. return $this->label;
  145. }
  146. /**
  147. * @param mixed $label
  148. * @return Catalogue
  149. */
  150. public function setLabel($label)
  151. {
  152. $this->label = $label;
  153. return $this;
  154. }
  155. /**
  156. * @return mixed
  157. */
  158. public function getEnabled()
  159. {
  160. return $this->enabled;
  161. }
  162. /**
  163. * @param mixed $enabled
  164. * @return Catalogue
  165. */
  166. public function setEnabled($enabled)
  167. {
  168. $this->enabled = $enabled;
  169. return $this;
  170. }
  171. /**
  172. * @return mixed
  173. */
  174. public function getStandAlone()
  175. {
  176. return $this->standAlone;
  177. }
  178. /**
  179. * @param mixed $standAlone
  180. * @return Catalogue
  181. */
  182. public function setStandAlone($standAlone)
  183. {
  184. $this->standAlone = $standAlone;
  185. return $this;
  186. }
  187. /**
  188. * @return mixed
  189. */
  190. public function getTypes()
  191. {
  192. return $this->types;
  193. }
  194. /**
  195. * @param mixed $types
  196. * @return Catalogue
  197. */
  198. public function setTypes($types)
  199. {
  200. $this->types = $types;
  201. return $this;
  202. }
  203. /**
  204. * @return mixed
  205. */
  206. public function getCampaigns()
  207. {
  208. return $this->campaigns;
  209. }
  210. /**
  211. * @param mixed $campaigns
  212. *
  213. * @return Catalogue
  214. */
  215. public function setCampaigns($campaigns)
  216. {
  217. $this->campaigns = $campaigns;
  218. return $this;
  219. }
  220. /**
  221. * @return mixed
  222. */
  223. public function getAlertStock()
  224. {
  225. return $this->alertStock;
  226. }
  227. /**
  228. * @param mixed $alertStock
  229. * @return Catalogue
  230. */
  231. public function setAlertStock($alertStock)
  232. {
  233. $this->alertStock = $alertStock;
  234. return $this;
  235. }
  236. /**
  237. * @return mixed
  238. */
  239. public function getInclude()
  240. {
  241. return $this->include;
  242. }
  243. /**
  244. * @param $include
  245. * @return $this
  246. */
  247. public function setInclude($include)
  248. {
  249. $this->include = $include;
  250. return $this;
  251. }
  252. /**
  253. * @return mixed
  254. */
  255. public function getFilters()
  256. {
  257. return $this->filters;
  258. }
  259. /**
  260. * @param $filters
  261. * @return $this
  262. */
  263. public function setFilters($filters)
  264. {
  265. $this->filters = $filters;
  266. return $this;
  267. }
  268. /**
  269. * @return mixed
  270. */
  271. public function getSorts()
  272. {
  273. return $this->sorts;
  274. }
  275. /**
  276. * @param $sorts
  277. * @return $this
  278. */
  279. public function setSorts($sorts)
  280. {
  281. $this->sorts = $sorts;
  282. return $this;
  283. }
  284. /**
  285. * @return mixed
  286. */
  287. public function getEnabledResetFilters()
  288. {
  289. return $this->enabledResetFilters;
  290. }
  291. /**
  292. * @param mixed $enabledResetFilters
  293. * @return Catalogue
  294. */
  295. public function setEnabledResetFilters($enabledResetFilters)
  296. {
  297. $this->enabledResetFilters = $enabledResetFilters;
  298. return $this;
  299. }
  300. /**
  301. * @return mixed
  302. */
  303. public function getFees()
  304. {
  305. return $this->fees;
  306. }
  307. /**
  308. * @param mixed $fees
  309. *
  310. * @return $this
  311. */
  312. public function setFees($fees): self
  313. {
  314. $this->fees = $fees;
  315. return $this;
  316. }
  317. /**
  318. * @return Collection<int, Slider>
  319. */
  320. public function getSliders(): Collection
  321. {
  322. return $this->sliders;
  323. }
  324. public function addSlider(Slider $slider): self
  325. {
  326. if (!$this->sliders->contains($slider)) {
  327. $this->sliders[] = $slider;
  328. $slider->setCatalog($this);
  329. }
  330. return $this;
  331. }
  332. public function removeSlider(Slider $slider): self
  333. {
  334. if ($this->sliders->removeElement($slider)) {
  335. // set the owning side to null (unless already changed)
  336. if ($slider->getCatalog() === $this) {
  337. $slider->setCatalog(null);
  338. }
  339. }
  340. return $this;
  341. }
  342. /**
  343. * @return mixed
  344. */
  345. public function getCanOrder()
  346. {
  347. return $this->canOrder;
  348. }
  349. /**
  350. * @param mixed $canOrder
  351. * @return Catalogue
  352. */
  353. public function setCanOrder($canOrder): Catalogue
  354. {
  355. $this->canOrder = $canOrder;
  356. return $this;
  357. }
  358. /**
  359. * @return bool
  360. */
  361. public function getDisplayIfNoStock(): bool
  362. {
  363. return $this->displayIfNoStock;
  364. }
  365. /**
  366. * @param bool $displayIfNoStock
  367. *
  368. * @return Catalogue
  369. */
  370. public function setDisplayIfNoStock(bool $displayIfNoStock): Catalogue
  371. {
  372. $this->displayIfNoStock = $displayIfNoStock;
  373. return $this;
  374. }
  375. /**
  376. * @return bool
  377. */
  378. public function getDisplayIfPriceZero(): bool
  379. {
  380. return $this->displayIfPriceZero;
  381. }
  382. /**
  383. * @param bool $displayIfPriceZero
  384. *
  385. * @return Catalogue
  386. */
  387. public function setDisplayIfPriceZero(bool $displayIfPriceZero): Catalogue
  388. {
  389. $this->displayIfPriceZero = $displayIfPriceZero;
  390. return $this;
  391. }
  392. /**
  393. * @return bool
  394. */
  395. public function getIsFilteredByParentBOCategory(): bool
  396. {
  397. return $this->isFilteredByParentBOCategory;
  398. }
  399. /**
  400. * @param bool $isFilteredByParentBOCategory
  401. *
  402. * @return Catalogue
  403. */
  404. public function setIsFilteredByParentBOCategory(bool $isFilteredByParentBOCategory): Catalogue
  405. {
  406. $this->isFilteredByParentBOCategory = $isFilteredByParentBOCategory;
  407. return $this;
  408. }
  409. /**
  410. * @return mixed
  411. */
  412. public function getHideFilters()
  413. {
  414. return $this->hideFilters;
  415. }
  416. /**
  417. * @param $hideFilters
  418. * @return $this
  419. */
  420. public function setHideFilters($hideFilters)
  421. {
  422. $this->hideFilters = $hideFilters;
  423. return $this;
  424. }
  425. /**
  426. * @return string|null
  427. */
  428. public function getSpecificExclusion(): ?string
  429. {
  430. return $this->specificExclusion;
  431. }
  432. /**
  433. * @param $specificExclusion
  434. * @return $this
  435. */
  436. public function setSpecificExclusion($specificExclusion)
  437. {
  438. $this->specificExclusion = $specificExclusion;
  439. return $this;
  440. }
  441. public function getOrderItem(): ?int
  442. {
  443. return $this->orderItem;
  444. }
  445. public function setOrderItem( int $orderItem ): self
  446. {
  447. $this->orderItem = $orderItem;
  448. return $this;
  449. }
  450. }