src/Entity/ProductModelDescription.php line 14

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_models_description")
  8. * @ORM\Entity
  9. * @ORM\HasLifecycleCallbacks()
  10. */
  11. class ProductModelDescription
  12. {
  13. /**
  14. * @var int
  15. *
  16. * @ORM\Column(name="id", type="integer", nullable=false)
  17. * @ORM\Id
  18. * @ORM\GeneratedValue(strategy="IDENTITY")
  19. */
  20. private $id;
  21. /** *
  22. * @var \App\Entity\ProductModel
  23. * @ORM\ManyToOne(targetEntity="App\Entity\ProductModel", inversedBy="descriptions", cascade={"persist"})
  24. * @ORM\JoinColumn(name="products_models_id", referencedColumnName="id", onDelete="CASCADE")
  25. */
  26. private $model;
  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="short_name", type="string", length=255, nullable=true)
  38. */
  39. private $shortName;
  40. /**
  41. * @var string
  42. *
  43. * @ORM\Column(name="name", type="string", length=255, nullable=false)
  44. */
  45. private $name;
  46. /**
  47. * @var string|null
  48. *
  49. * @ORM\Column(name="label", type="string", length=255, nullable=true)
  50. */
  51. private $label;
  52. /**
  53. * @var string|null
  54. *
  55. * @ORM\Column(name="heading_title", type="string", length=255, nullable=true)
  56. */
  57. private $headingTitle;
  58. /**
  59. * @var string|null
  60. *
  61. * @ORM\Column(name="short_description", type="string", length=255, nullable=true)
  62. */
  63. private $shortDescription;
  64. /**
  65. * @var string|null
  66. *
  67. * @ORM\Column(name="description", type="text", length=65535, nullable=true)
  68. */
  69. private $description;
  70. /**
  71. * @var string|null
  72. *
  73. * @ORM\Column(name="products_url", type="string", length=255, nullable=true)
  74. */
  75. private $url;
  76. /**
  77. * @var int|null
  78. *
  79. * @ORM\Column(name="products_viewed", type="integer", nullable=true)
  80. */
  81. private $viewed = 0;
  82. /**
  83. * @var string|null
  84. *
  85. * @ORM\Column(name="products_head_title_tag", type="string", length=80, nullable=true)
  86. */
  87. private $headTitleTag;
  88. /**
  89. * @var string
  90. *
  91. * @ORM\Column(name="products_head_desc_tag", type="string", length=160, nullable=false)
  92. */
  93. private $headDescTag;
  94. /**
  95. * @var string
  96. *
  97. * @ORM\Column(name="products_head_keywords_tag", type="text", length=0, nullable=false)
  98. */
  99. private $headKeywordsTag;
  100. /**
  101. * @var string|null
  102. *
  103. * @ORM\Column(name="products_video", type="text", length=65535, nullable=true)
  104. */
  105. private $video;
  106. /**
  107. * @var int
  108. *
  109. * @ORM\Column(name="products_conseil1", type="text", length=65535, nullable=false)
  110. */
  111. private $conseil = '';
  112. /**
  113. * @var string
  114. *
  115. * @ORM\Column(name="products_notice", type="string", length=69, nullable=false)
  116. */
  117. private $notice = '';
  118. /**
  119. * @var string|null
  120. *
  121. * @ORM\Column(name="products_tags", type="text", length=65535, nullable=true)
  122. */
  123. private $tags;
  124. public function getId() {
  125. return $this->id;
  126. }
  127. public function getProduct() {
  128. return $this->product;
  129. }
  130. public function getLanguage(): \App\Entity\Language {
  131. return $this->language;
  132. }
  133. public function getName() {
  134. return $this->name;
  135. }
  136. public function getLabel(): ?string {
  137. return $this->label;
  138. }
  139. public function getHeadingTitle(): ?string {
  140. return empty($this->headingTitle) ? $this->getName() : $this->headingTitle;
  141. }
  142. public function getDescription() {
  143. return $this->description;
  144. }
  145. public function getShortName(){
  146. return $this->shortName;
  147. }
  148. public function getShortDescription() {
  149. return $this->shortDescription;
  150. }
  151. public function getUrl() {
  152. return empty($this->url)?\App\Helpers\Encoder::formatUrl($this->getName()):$this->url;
  153. }
  154. public function getViewed() {
  155. return $this->viewed;
  156. }
  157. public function getMetaTitle() {
  158. return $this->getHeadTitleTag();
  159. }
  160. public function getHeadTitleTag() {
  161. return $this->headTitleTag;
  162. }
  163. public function getMetaDescription() {
  164. return $this->getHeadDescTag();
  165. }
  166. public function getHeadDescTag() {
  167. return $this->headDescTag;
  168. }
  169. public function getMetaKeywords() {
  170. return $this->getHeadKeywordsTag();
  171. }
  172. public function getHeadKeywordsTag() {
  173. return $this->headKeywordsTag;
  174. }
  175. public function getTeaser() {
  176. return $this->teaser;
  177. }
  178. public function getOp() {
  179. return $this->op;
  180. }
  181. public function getTop() {
  182. return $this->top;
  183. }
  184. public function getNew() {
  185. return $this->new;
  186. }
  187. public function getVideo() {
  188. return empty($this->video) ? null : $this->video;
  189. }
  190. public function getVideo2() {
  191. return empty($this->video2) ? null : $this->video2;
  192. }
  193. public function getAdvice() {
  194. return $this->getConseil1();
  195. }
  196. public function getConseil() {
  197. return $this->getConseil1();
  198. }
  199. public function getConseil1() {
  200. return $this->conseil1;
  201. }
  202. public function getConseil2() {
  203. return $this->conseil2;
  204. }
  205. public function getConseilCat() {
  206. return $this->conseilCat;
  207. }
  208. public function getNotice() {
  209. return empty($this->notice) ? null : $this->notice;
  210. }
  211. public function getNoticeUrl() {
  212. return self::NOTICE_PATH.$this->notice;
  213. }
  214. public function getNotice2() {
  215. return empty($this->notice2) ? null : $this->notice2;
  216. }
  217. public function getDoofinderBoost() {
  218. return $this->doofinderBoost;
  219. }
  220. public function getDoofinderIndexedText() {
  221. return $this->doofinderIndexedText;
  222. }
  223. public function getCategorie() {
  224. return $this->categorie;
  225. }
  226. public function getTags(): ?string {
  227. return $this->tags;
  228. }
  229. public function getModel(): \App\Entity\ProductModel {
  230. return $this->model;
  231. }
  232. public function setModel(\App\Entity\ProductModel $model): void {
  233. $this->model = $model;
  234. }
  235. public function setProduct($product) {
  236. $this->product = $product;
  237. }
  238. public function setLanguage(\App\Entity\Language $language) {
  239. $this->language = $language;
  240. }
  241. public function setName($name) {
  242. $this->name = $name;
  243. }
  244. public function setLabel(?string $label): void {
  245. $this->label = $label;
  246. }
  247. public function setHeadingTitle(?string $headingTitle): void {
  248. $this->headingTitle = $headingTitle;
  249. }
  250. public function setDescription($description) {
  251. $this->description = $description;
  252. }
  253. public function setShortName($shortName) {
  254. $this->shortName = $shortName;
  255. }
  256. public function setShortDescription($shortDescription) {
  257. $this->shortDescription = $shortDescription;
  258. }
  259. public function setUrl($url) {
  260. $this->url = $url;
  261. }
  262. public function setViewed($viewed) {
  263. $this->viewed = $viewed;
  264. }
  265. public function setHeadTitleTag($headTitleTag) {
  266. $this->headTitleTag = $headTitleTag;
  267. }
  268. public function setHeadDescTag($headDescTag) {
  269. $this->headDescTag = $headDescTag;
  270. }
  271. public function setHeadKeywordsTag($headKeywordsTag) {
  272. $this->headKeywordsTag = $headKeywordsTag;
  273. }
  274. public function setTeaser($teaser) {
  275. $this->teaser = $teaser;
  276. }
  277. public function setOp($op) {
  278. $this->op = $op;
  279. }
  280. public function setTop($top) {
  281. $this->top = $top;
  282. }
  283. public function setNew($new) {
  284. $this->new = $new;
  285. }
  286. public function setVideo($video) {
  287. $this->video = $video;
  288. }
  289. public function setVideo2($video2) {
  290. $this->video2 = $video2;
  291. }
  292. public function setConseil($conseil) {
  293. $this->setConseil1($conseil);
  294. }
  295. public function setConseil1($conseil1) {
  296. $this->conseil1 = $conseil1;
  297. }
  298. public function setConseil2($conseil2) {
  299. $this->conseil2 = $conseil2;
  300. }
  301. public function setConseilCat($conseilCat) {
  302. $this->conseilCat = $conseilCat;
  303. }
  304. public function setNotice($notice) {
  305. $this->notice = $notice;
  306. }
  307. public function setNotice2($notice2) {
  308. $this->notice2 = $notice2;
  309. }
  310. public function setDoofinderBoost($doofinderBoost) {
  311. $this->doofinderBoost = $doofinderBoost;
  312. }
  313. public function setDoofinderIndexedText($doofinderIndexedText) {
  314. $this->doofinderIndexedText = $doofinderIndexedText;
  315. }
  316. public function setCategorie($categorie) {
  317. $this->categorie = $categorie;
  318. }
  319. public function setTags(?string $tags): void {
  320. $this->tags = $tags;
  321. }
  322. /**
  323. * @ORM\PostLoad
  324. */
  325. public function postLoad(\Doctrine\ORM\Event\LifecycleEventArgs $args) {
  326. if (empty($this->conseil1) || ($this->conseil1 == '0')) {
  327. $this->conseil1 = '';
  328. }
  329. if (empty($this->conseil2) || ($this->conseil2 == '0')) {
  330. $this->conseil2 = '';
  331. }
  332. if (empty($this->notice1) || ($this->notice1 == 0)) {
  333. $this->notice1 = '';
  334. }
  335. if (empty($this->notice2) || ($this->notice2 == 0)) {
  336. $this->notice2 = '';
  337. }
  338. // $this->loadDescriptions($args->getObjectManager());
  339. }
  340. }