src/Entity/ProductDescription.php line 470

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5. * ProductsDescription
  6. *
  7. * @ORM\Table(name="products_description")
  8. * @ORM\Entity
  9. * @ORM\HasLifecycleCallbacks()
  10. */
  11. class ProductDescription
  12. {
  13. public const NOTICE_PATH = '/images/notice-utilisation/';
  14. /**
  15. * @var int
  16. *
  17. * @ORM\Column(name="id", type="integer", nullable=false)
  18. * @ORM\Id
  19. * @ORM\GeneratedValue(strategy="IDENTITY")
  20. */
  21. private $id;
  22. /** *
  23. * @ORM\ManyToOne(targetEntity="App\Entity\Product", inversedBy="descriptions")
  24. * @ORM\JoinColumn(name="products_id", referencedColumnName="products_id")
  25. */
  26. private $product;
  27. /**
  28. * @var \App\Entity\Language
  29. *
  30. * @ORM\ManyToOne(targetEntity="App\Entity\Language")
  31. * @ORM\JoinColumn(name="language_id", referencedColumnName="languages_id")
  32. */
  33. private $language;
  34. /**
  35. * @var string
  36. *
  37. * @ORM\Column(name="products_short_name", type="string", length=255, nullable=true)
  38. */
  39. private $shortName;
  40. /**
  41. * @var string
  42. *
  43. * @ORM\Column(name="products_name", type="string", length=255, nullable=false)
  44. */
  45. private $name;
  46. /**
  47. * @var string|null
  48. *
  49. * @ORM\Column(name="products_heading_title", type="string", length=255, nullable=true)
  50. */
  51. private $headingTitle;
  52. /**
  53. * @var string|null
  54. *
  55. * @ORM\Column(name="products_short_description", type="string", length=255, nullable=true)
  56. */
  57. private $shortDescription;
  58. /**
  59. * @var string|null
  60. *
  61. * @ORM\Column(name="products_description", type="text", length=65535, nullable=true)
  62. */
  63. private $description;
  64. /**
  65. * @var string|null
  66. *
  67. * @ORM\Column(name="products_url", type="string", length=255, nullable=true)
  68. */
  69. private $url;
  70. /**
  71. * @var int|null
  72. *
  73. * @ORM\Column(name="products_viewed", type="integer", nullable=true)
  74. */
  75. private $viewed = 0;
  76. /**
  77. * @var string|null
  78. *
  79. * @ORM\Column(name="products_head_title_tag", type="string", length=80, nullable=true)
  80. */
  81. private $headTitleTag;
  82. /**
  83. * @var string
  84. *
  85. * @ORM\Column(name="products_head_desc_tag", type="string", length=160, nullable=false)
  86. */
  87. private $headDescTag;
  88. /**
  89. * @var string
  90. *
  91. * @ORM\Column(name="products_head_keywords_tag", type="text", length=0, nullable=false)
  92. */
  93. private $headKeywordsTag;
  94. /**
  95. * @var string|null
  96. *
  97. * @ORM\Column(name="products_teaser", type="text", length=65535, nullable=true)
  98. */
  99. private $teaser;
  100. /**
  101. * @var string|null
  102. *
  103. * @ORM\Column(name="products_op", type="text", length=65535, nullable=true)
  104. */
  105. private $op;
  106. /**
  107. * @var int|null
  108. *
  109. * @ORM\Column(name="products_top", type="integer", nullable=true)
  110. */
  111. private $top;
  112. /**
  113. * @var int
  114. *
  115. * @ORM\Column(name="products_new", type="integer", nullable=false)
  116. */
  117. private $new = 0;
  118. /**
  119. * @var string|null
  120. *
  121. * @ORM\Column(name="products_video", type="text", length=65535, nullable=true)
  122. */
  123. private $video;
  124. /**
  125. * @var string|null
  126. *
  127. * @ORM\Column(name="products_video2", type="text", length=65535, nullable=true)
  128. */
  129. private $video2;
  130. /**
  131. * @var int
  132. *
  133. * @ORM\Column(name="products_conseil1", type="text", length=65535, nullable=false)
  134. */
  135. private $conseil1 = '';
  136. /**
  137. * @var int
  138. *
  139. * @ORM\Column(name="products_conseil2", type="text", length=65535, nullable=false)
  140. */
  141. private $conseil2 = '';
  142. /**
  143. * @var string
  144. *
  145. * @ORM\Column(name="products_conseil_cat", type="string", length=11, nullable=false)
  146. */
  147. private $conseilCat = '';
  148. /**
  149. * @var string
  150. *
  151. * @ORM\Column(name="products_notice", type="string", length=69, nullable=false)
  152. */
  153. private $notice = '';
  154. /**
  155. * @var string
  156. *
  157. * @ORM\Column(name="products_notice2", type="string", length=69, nullable=false)
  158. */
  159. private $notice2 = '';
  160. /**
  161. * @var float|null
  162. *
  163. * @ORM\Column(name="doofinder_boost", type="float", precision=2, scale=1, nullable=true, options={"default"="1.0"})
  164. */
  165. private $doofinderBoost = '1.0';
  166. /**
  167. * @var string
  168. *
  169. * @ORM\Column(name="doofinder_indexed_text", type="string", length=160, nullable=false)
  170. */
  171. private $doofinderIndexedText;
  172. /**
  173. * @var string
  174. *
  175. * @ORM\Column(name="products_categorie", type="string", length=160, nullable=false)
  176. */
  177. private $categorie = '';
  178. /**
  179. * @var string|null
  180. *
  181. * @ORM\Column(name="products_tags", type="text", length=65535, nullable=true)
  182. */
  183. private $tags;
  184. public function getId() {
  185. return $this->id;
  186. }
  187. public function getProduct() {
  188. return $this->product;
  189. }
  190. public function getLanguage(): \App\Entity\Language {
  191. return $this->language;
  192. }
  193. public function getName() {
  194. return $this->name;
  195. }
  196. public function getHeadingTitle(): ?string {
  197. return empty($this->headingTitle) ? $this->getName() : $this->headingTitle;
  198. }
  199. public function getDescription() {
  200. return $this->description;
  201. }
  202. public function getShortName(){
  203. return $this->shortName;
  204. }
  205. public function getShortDescription() {
  206. return $this->shortDescription;
  207. }
  208. public function getUrl() {
  209. return empty($this->url)?\App\Helpers\Encoder::formatUrl($this->getName()):$this->url;
  210. }
  211. public function getViewed() {
  212. return $this->viewed;
  213. }
  214. public function getMetaTitle() {
  215. return $this->getHeadTitleTag();
  216. }
  217. public function getHeadTitleTag() {
  218. return $this->headTitleTag;
  219. }
  220. public function getMetaDescription() {
  221. return $this->getHeadDescTag();
  222. }
  223. public function getHeadDescTag() {
  224. return $this->headDescTag;
  225. }
  226. public function getMetaKeywords() {
  227. return $this->getHeadKeywordsTag();
  228. }
  229. public function getHeadKeywordsTag() {
  230. return $this->headKeywordsTag;
  231. }
  232. public function getTeaser() {
  233. return $this->teaser;
  234. }
  235. public function getOp() {
  236. return $this->op;
  237. }
  238. public function getTop() {
  239. return $this->top;
  240. }
  241. public function getNew() {
  242. return $this->new;
  243. }
  244. public function getVideo() {
  245. return empty($this->video) ? null : $this->video;
  246. }
  247. public function getVideo2() {
  248. return empty($this->video2) ? null : $this->video2;
  249. }
  250. public function getAdvice() {
  251. return $this->getConseil1();
  252. }
  253. public function getConseil() {
  254. return $this->getConseil1();
  255. }
  256. public function getConseil1() {
  257. return $this->conseil1;
  258. }
  259. public function getConseil2() {
  260. return $this->conseil2;
  261. }
  262. public function getConseilCat() {
  263. return $this->conseilCat;
  264. }
  265. public function getNotice() {
  266. return empty($this->notice) ? null : $this->notice;
  267. }
  268. public function getNoticeUrl() {
  269. return self::NOTICE_PATH.$this->notice;
  270. }
  271. public function getNotice2() {
  272. return empty($this->notice2) ? null : $this->notice2;
  273. }
  274. public function getDoofinderBoost() {
  275. return $this->doofinderBoost;
  276. }
  277. public function getDoofinderIndexedText() {
  278. return $this->doofinderIndexedText;
  279. }
  280. public function getCategorie() {
  281. return $this->categorie;
  282. }
  283. public function getTags(): ?string {
  284. return $this->tags;
  285. }
  286. public function setProduct($product) {
  287. $this->product = $product;
  288. }
  289. public function setLanguage(\App\Entity\Language $language) {
  290. $this->language = $language;
  291. }
  292. public function setName($name) {
  293. $this->name = $name;
  294. }
  295. public function setHeadingTitle(?string $headingTitle): void {
  296. $this->headingTitle = $headingTitle;
  297. }
  298. public function setDescription($description) {
  299. $this->description = $description;
  300. }
  301. public function setShortName($shortName) {
  302. $this->shortName = $shortName;
  303. }
  304. public function setShortDescription($shortDescription) {
  305. $this->shortDescription = $shortDescription;
  306. }
  307. public function setUrl($url) {
  308. $this->url = $url;
  309. }
  310. public function setViewed($viewed) {
  311. $this->viewed = $viewed;
  312. }
  313. public function setHeadTitleTag($headTitleTag) {
  314. $this->headTitleTag = $headTitleTag;
  315. }
  316. public function setHeadDescTag($headDescTag) {
  317. $this->headDescTag = $headDescTag;
  318. }
  319. public function setHeadKeywordsTag($headKeywordsTag) {
  320. $this->headKeywordsTag = $headKeywordsTag;
  321. }
  322. public function setTeaser($teaser) {
  323. $this->teaser = $teaser;
  324. }
  325. public function setOp($op) {
  326. $this->op = $op;
  327. }
  328. public function setTop($top) {
  329. $this->top = $top;
  330. }
  331. public function setNew($new) {
  332. $this->new = $new;
  333. }
  334. public function setVideo($video) {
  335. $this->video = $video;
  336. }
  337. public function setVideo2($video2) {
  338. $this->video2 = $video2;
  339. }
  340. public function setConseil($conseil) {
  341. $this->setConseil1($conseil);
  342. }
  343. public function setConseil1($conseil1) {
  344. $this->conseil1 = $conseil1;
  345. }
  346. public function setConseil2($conseil2) {
  347. $this->conseil2 = $conseil2;
  348. }
  349. public function setConseilCat($conseilCat) {
  350. $this->conseilCat = $conseilCat;
  351. }
  352. public function setNotice($notice) {
  353. $this->notice = $notice;
  354. }
  355. public function setNotice2($notice2) {
  356. $this->notice2 = $notice2;
  357. }
  358. public function setDoofinderBoost($doofinderBoost) {
  359. $this->doofinderBoost = $doofinderBoost;
  360. }
  361. public function setDoofinderIndexedText($doofinderIndexedText) {
  362. $this->doofinderIndexedText = $doofinderIndexedText;
  363. }
  364. public function setCategorie($categorie) {
  365. $this->categorie = $categorie;
  366. }
  367. public function setTags(?string $tags): void {
  368. $this->tags = $tags;
  369. }
  370. /**
  371. * @ORM\PostLoad
  372. */
  373. public function postLoad(\Doctrine\ORM\Event\LifecycleEventArgs $args) {
  374. if (empty($this->conseil1) || ($this->conseil1 == '0')) {
  375. $this->conseil1 = '';
  376. }
  377. if (empty($this->conseil2) || ($this->conseil2 == '0')) {
  378. $this->conseil2 = '';
  379. }
  380. if (empty($this->notice1) || ($this->notice1 == 0)) {
  381. $this->notice1 = '';
  382. }
  383. if (empty($this->notice2) || ($this->notice2 == 0)) {
  384. $this->notice2 = '';
  385. }
  386. // $this->loadDescriptions($args->getObjectManager());
  387. }
  388. }