<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* ProductsDescription
*
* @ORM\Table(name="products_description")
* @ORM\Entity
* @ORM\HasLifecycleCallbacks()
*/
class ProductDescription
{
public const NOTICE_PATH = '/images/notice-utilisation/';
/**
* @var int
*
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/** *
* @ORM\ManyToOne(targetEntity="App\Entity\Product", inversedBy="descriptions")
* @ORM\JoinColumn(name="products_id", referencedColumnName="products_id")
*/
private $product;
/**
* @var \App\Entity\Language
*
* @ORM\ManyToOne(targetEntity="App\Entity\Language")
* @ORM\JoinColumn(name="language_id", referencedColumnName="languages_id")
*/
private $language;
/**
* @var string
*
* @ORM\Column(name="products_short_name", type="string", length=255, nullable=true)
*/
private $shortName;
/**
* @var string
*
* @ORM\Column(name="products_name", type="string", length=255, nullable=false)
*/
private $name;
/**
* @var string|null
*
* @ORM\Column(name="products_heading_title", type="string", length=255, nullable=true)
*/
private $headingTitle;
/**
* @var string|null
*
* @ORM\Column(name="products_short_description", type="string", length=255, nullable=true)
*/
private $shortDescription;
/**
* @var string|null
*
* @ORM\Column(name="products_description", type="text", length=65535, nullable=true)
*/
private $description;
/**
* @var string|null
*
* @ORM\Column(name="products_url", type="string", length=255, nullable=true)
*/
private $url;
/**
* @var int|null
*
* @ORM\Column(name="products_viewed", type="integer", nullable=true)
*/
private $viewed = 0;
/**
* @var string|null
*
* @ORM\Column(name="products_head_title_tag", type="string", length=80, nullable=true)
*/
private $headTitleTag;
/**
* @var string
*
* @ORM\Column(name="products_head_desc_tag", type="string", length=160, nullable=false)
*/
private $headDescTag;
/**
* @var string
*
* @ORM\Column(name="products_head_keywords_tag", type="text", length=0, nullable=false)
*/
private $headKeywordsTag;
/**
* @var string|null
*
* @ORM\Column(name="products_teaser", type="text", length=65535, nullable=true)
*/
private $teaser;
/**
* @var string|null
*
* @ORM\Column(name="products_op", type="text", length=65535, nullable=true)
*/
private $op;
/**
* @var int|null
*
* @ORM\Column(name="products_top", type="integer", nullable=true)
*/
private $top;
/**
* @var int
*
* @ORM\Column(name="products_new", type="integer", nullable=false)
*/
private $new = 0;
/**
* @var string|null
*
* @ORM\Column(name="products_video", type="text", length=65535, nullable=true)
*/
private $video;
/**
* @var string|null
*
* @ORM\Column(name="products_video2", type="text", length=65535, nullable=true)
*/
private $video2;
/**
* @var int
*
* @ORM\Column(name="products_conseil1", type="text", length=65535, nullable=false)
*/
private $conseil1 = '';
/**
* @var int
*
* @ORM\Column(name="products_conseil2", type="text", length=65535, nullable=false)
*/
private $conseil2 = '';
/**
* @var string
*
* @ORM\Column(name="products_conseil_cat", type="string", length=11, nullable=false)
*/
private $conseilCat = '';
/**
* @var string
*
* @ORM\Column(name="products_notice", type="string", length=69, nullable=false)
*/
private $notice = '';
/**
* @var string
*
* @ORM\Column(name="products_notice2", type="string", length=69, nullable=false)
*/
private $notice2 = '';
/**
* @var float|null
*
* @ORM\Column(name="doofinder_boost", type="float", precision=2, scale=1, nullable=true, options={"default"="1.0"})
*/
private $doofinderBoost = '1.0';
/**
* @var string
*
* @ORM\Column(name="doofinder_indexed_text", type="string", length=160, nullable=false)
*/
private $doofinderIndexedText;
/**
* @var string
*
* @ORM\Column(name="products_categorie", type="string", length=160, nullable=false)
*/
private $categorie = '';
/**
* @var string|null
*
* @ORM\Column(name="products_tags", type="text", length=65535, nullable=true)
*/
private $tags;
public function getId() {
return $this->id;
}
public function getProduct() {
return $this->product;
}
public function getLanguage(): \App\Entity\Language {
return $this->language;
}
public function getName() {
return $this->name;
}
public function getHeadingTitle(): ?string {
return empty($this->headingTitle) ? $this->getName() : $this->headingTitle;
}
public function getDescription() {
return $this->description;
}
public function getShortName(){
return $this->shortName;
}
public function getShortDescription() {
return $this->shortDescription;
}
public function getUrl() {
return empty($this->url)?\App\Helpers\Encoder::formatUrl($this->getName()):$this->url;
}
public function getViewed() {
return $this->viewed;
}
public function getMetaTitle() {
return $this->getHeadTitleTag();
}
public function getHeadTitleTag() {
return $this->headTitleTag;
}
public function getMetaDescription() {
return $this->getHeadDescTag();
}
public function getHeadDescTag() {
return $this->headDescTag;
}
public function getMetaKeywords() {
return $this->getHeadKeywordsTag();
}
public function getHeadKeywordsTag() {
return $this->headKeywordsTag;
}
public function getTeaser() {
return $this->teaser;
}
public function getOp() {
return $this->op;
}
public function getTop() {
return $this->top;
}
public function getNew() {
return $this->new;
}
public function getVideo() {
return empty($this->video) ? null : $this->video;
}
public function getVideo2() {
return empty($this->video2) ? null : $this->video2;
}
public function getAdvice() {
return $this->getConseil1();
}
public function getConseil() {
return $this->getConseil1();
}
public function getConseil1() {
return $this->conseil1;
}
public function getConseil2() {
return $this->conseil2;
}
public function getConseilCat() {
return $this->conseilCat;
}
public function getNotice() {
return empty($this->notice) ? null : $this->notice;
}
public function getNoticeUrl() {
return self::NOTICE_PATH.$this->notice;
}
public function getNotice2() {
return empty($this->notice2) ? null : $this->notice2;
}
public function getDoofinderBoost() {
return $this->doofinderBoost;
}
public function getDoofinderIndexedText() {
return $this->doofinderIndexedText;
}
public function getCategorie() {
return $this->categorie;
}
public function getTags(): ?string {
return $this->tags;
}
public function setProduct($product) {
$this->product = $product;
}
public function setLanguage(\App\Entity\Language $language) {
$this->language = $language;
}
public function setName($name) {
$this->name = $name;
}
public function setHeadingTitle(?string $headingTitle): void {
$this->headingTitle = $headingTitle;
}
public function setDescription($description) {
$this->description = $description;
}
public function setShortName($shortName) {
$this->shortName = $shortName;
}
public function setShortDescription($shortDescription) {
$this->shortDescription = $shortDescription;
}
public function setUrl($url) {
$this->url = $url;
}
public function setViewed($viewed) {
$this->viewed = $viewed;
}
public function setHeadTitleTag($headTitleTag) {
$this->headTitleTag = $headTitleTag;
}
public function setHeadDescTag($headDescTag) {
$this->headDescTag = $headDescTag;
}
public function setHeadKeywordsTag($headKeywordsTag) {
$this->headKeywordsTag = $headKeywordsTag;
}
public function setTeaser($teaser) {
$this->teaser = $teaser;
}
public function setOp($op) {
$this->op = $op;
}
public function setTop($top) {
$this->top = $top;
}
public function setNew($new) {
$this->new = $new;
}
public function setVideo($video) {
$this->video = $video;
}
public function setVideo2($video2) {
$this->video2 = $video2;
}
public function setConseil($conseil) {
$this->setConseil1($conseil);
}
public function setConseil1($conseil1) {
$this->conseil1 = $conseil1;
}
public function setConseil2($conseil2) {
$this->conseil2 = $conseil2;
}
public function setConseilCat($conseilCat) {
$this->conseilCat = $conseilCat;
}
public function setNotice($notice) {
$this->notice = $notice;
}
public function setNotice2($notice2) {
$this->notice2 = $notice2;
}
public function setDoofinderBoost($doofinderBoost) {
$this->doofinderBoost = $doofinderBoost;
}
public function setDoofinderIndexedText($doofinderIndexedText) {
$this->doofinderIndexedText = $doofinderIndexedText;
}
public function setCategorie($categorie) {
$this->categorie = $categorie;
}
public function setTags(?string $tags): void {
$this->tags = $tags;
}
/**
* @ORM\PostLoad
*/
public function postLoad(\Doctrine\ORM\Event\LifecycleEventArgs $args) {
if (empty($this->conseil1) || ($this->conseil1 == '0')) {
$this->conseil1 = '';
}
if (empty($this->conseil2) || ($this->conseil2 == '0')) {
$this->conseil2 = '';
}
if (empty($this->notice1) || ($this->notice1 == 0)) {
$this->notice1 = '';
}
if (empty($this->notice2) || ($this->notice2 == 0)) {
$this->notice2 = '';
}
// $this->loadDescriptions($args->getObjectManager());
}
}