src/Entity/Page.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Category;
  4. use App\Entity\SubCategory;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use App\Repository\PageRepository;
  8. use Doctrine\Common\Collections\Collection;
  9. use Doctrine\Common\Collections\ArrayCollection;
  10. #[ORM\Entity(repositoryClassPageRepository::class)]
  11. class Page
  12. {
  13.     CONST TYPE_DEMENENAGEMENT_PARTICULIER "particulier";
  14.     CONST TYPE_DEMENENAGEMENT_ENTREPRISE "entreprise";
  15.     CONST TYPE_PROPOS "propos";
  16.     #[ORM\Id]
  17.     #[ORM\GeneratedValue]
  18.     #[ORM\Column]
  19.     private ?int $id null;
  20.     #[ORM\Column(length255)]
  21.     private ?string $name null;
  22.     #[ORM\Column(length255)]
  23.     private ?string $slug null;
  24.     #[ORM\Column(length255nullabletrue)]
  25.     private ?string $description null;
  26.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  27.     private ?string $body null;
  28.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  29.     private ?string $body1 null;
  30.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  31.     private ?string $body2 null;
  32.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  33.     private ?string $title null;
  34.     #[ORM\Column(typeTypes::ARRAY, nullabletrue)]
  35.     private array $keywords = [];
  36.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  37.     private ?string $courteDescription null;
  38.     #[ORM\Column]
  39.     private ?bool $enable true;
  40.     #[ORM\Column(length100nullabletrue)]
  41.     private ?string $type null;
  42.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  43.     private ?\DateTimeInterface $createdAt null;
  44.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  45.     private ?\DateTimeInterface $updateAt null;
  46.     #[ORM\ManyToOne(targetEntityCategory::class, inversedBy'pages')]
  47.     private Category $category;
  48.     #[ORM\ManyToOne(inversedBy'pages'targetEntitySubCategory::class)]
  49.     private SubCategory $subCategory;
  50.     #[ORM\Column(length255nullabletrue)]
  51.     private ?string $filename null;
  52.     #[ORM\Column(length255nullabletrue)]
  53.     private ?string $textSlider null;
  54.     #[ORM\Column(length255nullabletrue)]
  55.     private ?string $labelWhite null;
  56.     #[ORM\Column(length255nullabletrue)]
  57.     private ?string $priceLabel null;
  58.     #[ORM\Column(length255nullabletrue)]
  59.     private ?string $title_seo null;
  60.     public function __construct()
  61.     {
  62.     }
  63.     public function getId(): ?int
  64.     {
  65.         return $this->id;
  66.     }
  67.     public function getName(): ?string
  68.     {
  69.         return $this->name;
  70.     }
  71.     public function setName(string $name): self
  72.     {
  73.         $this->name $name;
  74.         return $this;
  75.     }
  76.     public function getSlug(): ?string
  77.     {
  78.         return $this->slug;
  79.     }
  80.     public function setSlug(string $slug): self
  81.     {
  82.         $this->slug $slug;
  83.         return $this;
  84.     }
  85.     public function getDescription(): ?string
  86.     {
  87.         return $this->description;
  88.     }
  89.     public function setDescription(?string $description): self
  90.     {
  91.         $this->description $description;
  92.         return $this;
  93.     }
  94.     public function getBody(): ?string
  95.     {
  96.         return $this->body;
  97.     }
  98.     public function setBody(?string $body): self
  99.     {
  100.         $this->body $body;
  101.         return $this;
  102.     }
  103.     /** */
  104.     public function getBody1(): ?string
  105.     {
  106.         return $this->body1;
  107.     }
  108.     public function setBody1(?string $body1): self
  109.     {
  110.         $this->body1 $body1;
  111.         return $this;
  112.     }
  113.     /** */
  114.     /** */
  115.     public function getBody2(): ?string
  116.     {
  117.         return $this->body2;
  118.     }
  119.     public function setBody2(?string $body2): self
  120.     {
  121.         $this->body2 $body2;
  122.         return $this;
  123.     }
  124.     /** */
  125.     public function getTitle(): ?string
  126.     {
  127.         return $this->title;
  128.     }
  129.     public function setTitle(?string $title): self
  130.     {
  131.         $this->title $title;
  132.         return $this;
  133.     }
  134.     public function getKeywords(): array
  135.     {
  136.         return $this->keywords;
  137.     }
  138.     public function setKeywords(?array $keywords): self
  139.     {
  140.         $this->keywords $keywords;
  141.         return $this;
  142.     }
  143.     public function getCourteDescription(): ?string
  144.     {
  145.         return $this->courteDescription;
  146.     }
  147.     public function setCourteDescription(?string $courteDescription): self
  148.     {
  149.         $this->courteDescription $courteDescription;
  150.         return $this;
  151.     }
  152.     public function isEnable(): ?bool
  153.     {
  154.         return $this->enable;
  155.     }
  156.     public function setEnable(bool $enable): self
  157.     {
  158.         $this->enable $enable;
  159.         return $this;
  160.     }
  161.     public function getKeywordList():string {
  162.         return implode(",",$this->keywords);
  163.     }
  164.     public function getCreatedAt(): ?\DateTimeInterface
  165.     {
  166.         return $this->createdAt;
  167.     }
  168.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  169.     {
  170.         $this->createdAt $createdAt;
  171.         return $this;
  172.     }
  173.     public function getUpdateAt(): ?\DateTimeInterface
  174.     {
  175.         return $this->updateAt;
  176.     }
  177.     public function setUpdateAt(?\DateTimeInterface $updateAt): self
  178.     {
  179.         $this->updateAt $updateAt;
  180.         return $this;
  181.     }
  182.     /**
  183.      * Get the value of type
  184.      */ 
  185.     public function getType()
  186.     {
  187.         return $this->type;
  188.     }
  189.     /**
  190.      * Set the value of type
  191.      *
  192.      * @return  self
  193.      */ 
  194.     public function setType($type)
  195.     {
  196.         $this->type $type;
  197.         return $this;
  198.     }
  199.     /**
  200.      * Get the value of category
  201.      */ 
  202.     public function getCategory()
  203.     {
  204.         if($this->subCategory){
  205.             return $this->subCategory->getMainCategory();
  206.         }
  207.     
  208.         return $this->category;
  209.     }
  210.     /**
  211.      * Set the value of category
  212.      *
  213.      * @return  self
  214.      */ 
  215.     public function setCategory(Category $category)
  216.     {
  217.         $this->category $category;
  218.         return $this;
  219.     }
  220.     /**
  221.      * Get the value of subCategory
  222.      */ 
  223.     public function getSubCategory()
  224.     {
  225.         return $this->subCategory;
  226.     }
  227.     /**
  228.      * Set the value of subCategory
  229.      *
  230.      * @return  self
  231.      */ 
  232.     public function setSubCategory($subCategory)
  233.     {
  234.         $this->subCategory $subCategory;
  235.         return $this;
  236.     }
  237.     /**
  238.      * Get the value of filename
  239.      */ 
  240.     public function getFilename()
  241.     {
  242.         return $this->filename;
  243.     }
  244.     /**
  245.      * Set the value of filename
  246.      *
  247.      * @return  self
  248.      */ 
  249.     public function setFilename($filename)
  250.     {
  251.         $this->filename $filename;
  252.         return $this;
  253.     }
  254.     public function getTextSlider(): ?string
  255.     {
  256.         return $this->textSlider;
  257.     }
  258.     public function setTextSlider(?string $textSlider): static
  259.     {
  260.         $this->textSlider $textSlider;
  261.         return $this;
  262.     }
  263.     public function getLabelWhite(): ?string
  264.     {
  265.         return $this->labelWhite;
  266.     }
  267.     public function setLabelWhite(?string $labelWhite): static
  268.     {
  269.         $this->labelWhite $labelWhite;
  270.         return $this;
  271.     }
  272.     public function getPriceLabel(): ?string
  273.     {
  274.         return $this->priceLabel;
  275.     }
  276.     public function setPriceLabel(?string $priceLabel): static
  277.     {
  278.         $this->priceLabel $priceLabel;
  279.         return $this;
  280.     }
  281.     public function getTitleSeo(): ?string
  282.     {
  283.         return $this->title_seo;
  284.     }
  285.     public function setTitleSeo(?string $title_seo): static
  286.     {
  287.         $this->title_seo $title_seo;
  288.         return $this;
  289.     }
  290. }