<?php
namespace App\Entity;
use App\Entity\Category;
use App\Entity\SubCategory;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use App\Repository\PageRepository;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\ArrayCollection;
#[ORM\Entity(repositoryClass: PageRepository::class)]
class Page
{
CONST TYPE_DEMENENAGEMENT_PARTICULIER = "particulier";
CONST TYPE_DEMENENAGEMENT_ENTREPRISE = "entreprise";
CONST TYPE_PROPOS = "propos";
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\Column(length: 255)]
private ?string $slug = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $description = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $body = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $body1 = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $body2 = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $title = null;
#[ORM\Column(type: Types::ARRAY, nullable: true)]
private array $keywords = [];
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $courteDescription = null;
#[ORM\Column]
private ?bool $enable = true;
#[ORM\Column(length: 100, nullable: true)]
private ?string $type = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $createdAt = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $updateAt = null;
#[ORM\ManyToOne(targetEntity: Category::class, inversedBy: 'pages')]
private Category $category;
#[ORM\ManyToOne(inversedBy: 'pages', targetEntity: SubCategory::class)]
private SubCategory $subCategory;
#[ORM\Column(length: 255, nullable: true)]
private ?string $filename = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $textSlider = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $labelWhite = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $priceLabel = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $title_seo = null;
public function __construct()
{
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(string $slug): self
{
$this->slug = $slug;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getBody(): ?string
{
return $this->body;
}
public function setBody(?string $body): self
{
$this->body = $body;
return $this;
}
/** */
public function getBody1(): ?string
{
return $this->body1;
}
public function setBody1(?string $body1): self
{
$this->body1 = $body1;
return $this;
}
/** */
/** */
public function getBody2(): ?string
{
return $this->body2;
}
public function setBody2(?string $body2): self
{
$this->body2 = $body2;
return $this;
}
/** */
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(?string $title): self
{
$this->title = $title;
return $this;
}
public function getKeywords(): array
{
return $this->keywords;
}
public function setKeywords(?array $keywords): self
{
$this->keywords = $keywords;
return $this;
}
public function getCourteDescription(): ?string
{
return $this->courteDescription;
}
public function setCourteDescription(?string $courteDescription): self
{
$this->courteDescription = $courteDescription;
return $this;
}
public function isEnable(): ?bool
{
return $this->enable;
}
public function setEnable(bool $enable): self
{
$this->enable = $enable;
return $this;
}
public function getKeywordList():string {
return implode(",",$this->keywords);
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdateAt(): ?\DateTimeInterface
{
return $this->updateAt;
}
public function setUpdateAt(?\DateTimeInterface $updateAt): self
{
$this->updateAt = $updateAt;
return $this;
}
/**
* Get the value of type
*/
public function getType()
{
return $this->type;
}
/**
* Set the value of type
*
* @return self
*/
public function setType($type)
{
$this->type = $type;
return $this;
}
/**
* Get the value of category
*/
public function getCategory()
{
if($this->subCategory){
return $this->subCategory->getMainCategory();
}
return $this->category;
}
/**
* Set the value of category
*
* @return self
*/
public function setCategory(Category $category)
{
$this->category = $category;
return $this;
}
/**
* Get the value of subCategory
*/
public function getSubCategory()
{
return $this->subCategory;
}
/**
* Set the value of subCategory
*
* @return self
*/
public function setSubCategory($subCategory)
{
$this->subCategory = $subCategory;
return $this;
}
/**
* Get the value of filename
*/
public function getFilename()
{
return $this->filename;
}
/**
* Set the value of filename
*
* @return self
*/
public function setFilename($filename)
{
$this->filename = $filename;
return $this;
}
public function getTextSlider(): ?string
{
return $this->textSlider;
}
public function setTextSlider(?string $textSlider): static
{
$this->textSlider = $textSlider;
return $this;
}
public function getLabelWhite(): ?string
{
return $this->labelWhite;
}
public function setLabelWhite(?string $labelWhite): static
{
$this->labelWhite = $labelWhite;
return $this;
}
public function getPriceLabel(): ?string
{
return $this->priceLabel;
}
public function setPriceLabel(?string $priceLabel): static
{
$this->priceLabel = $priceLabel;
return $this;
}
public function getTitleSeo(): ?string
{
return $this->title_seo;
}
public function setTitleSeo(?string $title_seo): static
{
$this->title_seo = $title_seo;
return $this;
}
}