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", nullable=true)
  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. /**
  110. * @ORM\Column(type="boolean")
  111. */
  112. private bool $isClearance = false;
  113. /**
  114. * @ORM\Column(type="integer", nullable=true)
  115. */
  116. private ?int $discountPrice;
  117. /**
  118. * @ORM\Column(type="integer", nullable=true)
  119. */
  120. private ?int $increasePrice;
  121. /**
  122. * @ORM\Column(type="integer", nullable=true)
  123. */
  124. private ?int $superiorMarkRate;
  125. /**
  126. * @ORM\Column(type="integer", nullable=true)
  127. */
  128. private ?int $lowerMarkRate;
  129. public function __construct()
  130. {
  131. $this->sliders = new ArrayCollection();
  132. }
  133. public function __toString(): string
  134. {
  135. return $this->getSlug();
  136. }
  137. public function getId(): ?int
  138. {
  139. return $this->id;
  140. }
  141. public function getSlug(): ?string
  142. {
  143. return $this->slug;
  144. }
  145. public function setSlug(?string $slug): self
  146. {
  147. $this->slug = $slug;
  148. return $this;
  149. }
  150. public function getSettingCatalogue(): ?Setting
  151. {
  152. return $this->settingCatalogue;
  153. }
  154. public function setSettingCatalogue(?Setting $settingCatalogue): self
  155. {
  156. $this->settingCatalogue = $settingCatalogue;
  157. return $this;
  158. }
  159. /**
  160. * @return mixed
  161. */
  162. public function getLabel()
  163. {
  164. return $this->label;
  165. }
  166. /**
  167. * @param mixed $label
  168. *
  169. * @return Catalogue
  170. */
  171. public function setLabel($label)
  172. {
  173. $this->label = $label;
  174. return $this;
  175. }
  176. /**
  177. * @return mixed
  178. */
  179. public function getEnabled()
  180. {
  181. return $this->enabled;
  182. }
  183. /**
  184. * @param mixed $enabled
  185. *
  186. * @return Catalogue
  187. */
  188. public function setEnabled($enabled)
  189. {
  190. $this->enabled = $enabled;
  191. return $this;
  192. }
  193. /**
  194. * @return mixed
  195. */
  196. public function getStandAlone()
  197. {
  198. return $this->standAlone;
  199. }
  200. /**
  201. * @param mixed $standAlone
  202. *
  203. * @return Catalogue
  204. */
  205. public function setStandAlone($standAlone)
  206. {
  207. $this->standAlone = $standAlone;
  208. return $this;
  209. }
  210. /**
  211. * @return mixed
  212. */
  213. public function getTypes()
  214. {
  215. return $this->types;
  216. }
  217. /**
  218. * @param mixed $types
  219. *
  220. * @return Catalogue
  221. */
  222. public function setTypes($types)
  223. {
  224. $this->types = $types;
  225. return $this;
  226. }
  227. /**
  228. * @return mixed
  229. */
  230. public function getCampaigns()
  231. {
  232. return $this->campaigns;
  233. }
  234. /**
  235. * @param mixed $campaigns
  236. *
  237. * @return Catalogue
  238. */
  239. public function setCampaigns($campaigns)
  240. {
  241. $this->campaigns = $campaigns;
  242. return $this;
  243. }
  244. /**
  245. * @return mixed
  246. */
  247. public function getAlertStock()
  248. {
  249. return $this->alertStock;
  250. }
  251. /**
  252. * @param mixed $alertStock
  253. *
  254. * @return Catalogue
  255. */
  256. public function setAlertStock($alertStock)
  257. {
  258. $this->alertStock = $alertStock;
  259. return $this;
  260. }
  261. /**
  262. * @return mixed
  263. */
  264. public function getInclude()
  265. {
  266. return $this->include;
  267. }
  268. /**
  269. * @param $include
  270. *
  271. * @return $this
  272. */
  273. public function setInclude($include)
  274. {
  275. $this->include = $include;
  276. return $this;
  277. }
  278. /**
  279. * @return mixed
  280. */
  281. public function getFilters()
  282. {
  283. return $this->filters;
  284. }
  285. /**
  286. * @param $filters
  287. *
  288. * @return $this
  289. */
  290. public function setFilters($filters)
  291. {
  292. $this->filters = $filters;
  293. return $this;
  294. }
  295. /**
  296. * @return mixed
  297. */
  298. public function getSorts()
  299. {
  300. return $this->sorts;
  301. }
  302. /**
  303. * @param $sorts
  304. *
  305. * @return $this
  306. */
  307. public function setSorts($sorts)
  308. {
  309. $this->sorts = $sorts;
  310. return $this;
  311. }
  312. /**
  313. * @return mixed
  314. */
  315. public function getEnabledResetFilters()
  316. {
  317. return $this->enabledResetFilters;
  318. }
  319. /**
  320. * @param mixed $enabledResetFilters
  321. *
  322. * @return Catalogue
  323. */
  324. public function setEnabledResetFilters($enabledResetFilters)
  325. {
  326. $this->enabledResetFilters = $enabledResetFilters;
  327. return $this;
  328. }
  329. /**
  330. * @return mixed
  331. */
  332. public function getFees()
  333. {
  334. return $this->fees;
  335. }
  336. /**
  337. * @param mixed $fees
  338. *
  339. * @return $this
  340. */
  341. public function setFees($fees): self
  342. {
  343. $this->fees = $fees;
  344. return $this;
  345. }
  346. /**
  347. * @return Collection<int, Slider>
  348. */
  349. public function getSliders(): Collection
  350. {
  351. return $this->sliders;
  352. }
  353. public function addSlider(Slider $slider): self
  354. {
  355. if (!$this->sliders->contains($slider)) {
  356. $this->sliders[] = $slider;
  357. $slider->setCatalog($this);
  358. }
  359. return $this;
  360. }
  361. public function removeSlider(Slider $slider): self
  362. {
  363. if ($this->sliders->removeElement($slider)) {
  364. // set the owning side to null (unless already changed)
  365. if ($slider->getCatalog() === $this) {
  366. $slider->setCatalog(null);
  367. }
  368. }
  369. return $this;
  370. }
  371. /**
  372. * @return mixed
  373. */
  374. public function getCanOrder()
  375. {
  376. return $this->canOrder;
  377. }
  378. /**
  379. * @param mixed $canOrder
  380. *
  381. * @return Catalogue
  382. */
  383. public function setCanOrder($canOrder): Catalogue
  384. {
  385. $this->canOrder = $canOrder;
  386. return $this;
  387. }
  388. /**
  389. * @return bool
  390. */
  391. public function getDisplayIfNoStock(): bool
  392. {
  393. return $this->displayIfNoStock;
  394. }
  395. /**
  396. * @param bool $displayIfNoStock
  397. *
  398. * @return Catalogue
  399. */
  400. public function setDisplayIfNoStock(bool $displayIfNoStock): Catalogue
  401. {
  402. $this->displayIfNoStock = $displayIfNoStock;
  403. return $this;
  404. }
  405. /**
  406. * @return bool
  407. */
  408. public function getDisplayIfPriceZero(): bool
  409. {
  410. return $this->displayIfPriceZero;
  411. }
  412. /**
  413. * @param bool $displayIfPriceZero
  414. *
  415. * @return Catalogue
  416. */
  417. public function setDisplayIfPriceZero(bool $displayIfPriceZero): Catalogue
  418. {
  419. $this->displayIfPriceZero = $displayIfPriceZero;
  420. return $this;
  421. }
  422. /**
  423. * @return bool
  424. */
  425. public function getIsFilteredByParentBOCategory(): bool
  426. {
  427. return $this->isFilteredByParentBOCategory;
  428. }
  429. /**
  430. * @param bool $isFilteredByParentBOCategory
  431. *
  432. * @return Catalogue
  433. */
  434. public function setIsFilteredByParentBOCategory(bool $isFilteredByParentBOCategory): Catalogue
  435. {
  436. $this->isFilteredByParentBOCategory = $isFilteredByParentBOCategory;
  437. return $this;
  438. }
  439. /**
  440. * @return mixed
  441. */
  442. public function getHideFilters()
  443. {
  444. return $this->hideFilters;
  445. }
  446. /**
  447. * @param $hideFilters
  448. *
  449. * @return $this
  450. */
  451. public function setHideFilters($hideFilters)
  452. {
  453. $this->hideFilters = $hideFilters;
  454. return $this;
  455. }
  456. /**
  457. * @return string|null
  458. */
  459. public function getSpecificExclusion(): ?string
  460. {
  461. return $this->specificExclusion;
  462. }
  463. /**
  464. * @param $specificExclusion
  465. *
  466. * @return $this
  467. */
  468. public function setSpecificExclusion($specificExclusion)
  469. {
  470. $this->specificExclusion = $specificExclusion;
  471. return $this;
  472. }
  473. public function getOrderItem(): ?int
  474. {
  475. return $this->orderItem;
  476. }
  477. public function setOrderItem(int $orderItem): self
  478. {
  479. $this->orderItem = $orderItem;
  480. return $this;
  481. }
  482. public function isClearance(): bool
  483. {
  484. return $this->isClearance;
  485. }
  486. public function setIsClearance(bool $isClearance): self
  487. {
  488. $this->isClearance = $isClearance;
  489. return $this;
  490. }
  491. public function getDiscountPrice(): ?int
  492. {
  493. return $this->discountPrice;
  494. }
  495. public function setDiscountPrice(?int $discountPrice): self
  496. {
  497. $this->discountPrice = $discountPrice;
  498. return $this;
  499. }
  500. public function getIncreasePrice(): ?int
  501. {
  502. return $this->increasePrice;
  503. }
  504. public function setIncreasePrice(?int $increasePrice): self
  505. {
  506. $this->increasePrice = $increasePrice;
  507. return $this;
  508. }
  509. public function getSuperiorMarkRate(): ?int
  510. {
  511. return $this->superiorMarkRate;
  512. }
  513. public function setSuperiorMarkRate(?int $SuperiorMarkRate): self
  514. {
  515. $this->superiorMarkRate = $SuperiorMarkRate;
  516. return $this;
  517. }
  518. public function getLowerMarkRate(): ?int
  519. {
  520. return $this->lowerMarkRate;
  521. }
  522. public function setLowerMarkRate(?int $lowerMarkRate): self
  523. {
  524. $this->lowerMarkRate = $lowerMarkRate;
  525. return $this;
  526. }
  527. }