src/Entity/Page/Page.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Page;
  3. use App\Entity\Components\HardComponent;
  4. use App\Entity\Page\ContentGroupPage;
  5. use App\Entity\Page\PageType;
  6. use App\Repository\Page\PageRepository;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\Common\Collections\Collection;
  9. use Doctrine\DBAL\Types\Types;
  10. use Doctrine\ORM\Mapping as ORM;
  11. #[ORM\Entity(repositoryClassPageRepository::class)]
  12. class Page
  13. {
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column]
  17.     private ?int $id null;
  18.     #[ORM\Column(length255nullabletrue)]
  19.     private ?string $name null;
  20.     #[ORM\Column(length255nullabletrue)]
  21.     private ?string $title null;
  22.     #[ORM\Column(length255nullabletrue)]
  23.     private ?string $status null;
  24.     #[ORM\Column(length255nullabletrue)]
  25.     private ?string $metaDescription null;
  26.     #[ORM\Column(length255nullabletrue)]
  27.     private ?string $metaImg null;
  28.     #[ORM\Column(length255nullabletrue)]
  29.     private ?string $javascriptAdd null;
  30.     #[ORM\Column(length255nullabletrue)]
  31.     private ?string $cssAdd null;
  32.     #[ORM\Column(typeTypes::TEXT)]
  33.     private ?string $content null;
  34.     #[ORM\Column(length255)]
  35.     private ?string $urlAccess null;
  36.     #[ORM\Column]
  37.     private ?bool $is_activ null;
  38.     #[ORM\Column]
  39.     private ?bool $is_contact null;
  40.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  41.     private ?string $draft null;
  42.     #[ORM\Column(length30nullabletrue)]
  43.     private ?string $skeleton null;
  44.     #[ORM\ManyToOne]
  45.     private ?HardComponent $hardComponent null;
  46.     #[ORM\Column(nullabletrue)]
  47.     private ?bool $is_headerComponent null;
  48.     #[ORM\Column(nullabletrue)]
  49.     private ?bool $is_noIndex null;
  50.     #[ORM\Column(nullabletrue)]
  51.     private ?bool $is_home null;
  52.     #[ORM\Column(nullabletrue)]
  53.     private ?bool $is_legal null;
  54.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  55.     private ?\DateTimeInterface $created_at null;
  56.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  57.     private ?\DateTimeInterface $updated_at null;
  58.     #[ORM\ManyToOne(inversedBy'pages')]
  59.     private ?PageType $pageType null;
  60.     #[ORM\Column(length30nullabletrue)]
  61.     private ?string $visibility null;
  62.     #[ORM\Column(nullabletrue)]
  63.     private ?int $readingOrder null;
  64.     #[ORM\OneToMany(mappedBy'page'targetEntityContentGroupPage::class)]
  65.     private Collection $contentGroupPages;
  66.     public function __construct()
  67.     {
  68.         $this->contentGroupPages = new ArrayCollection();
  69.     }
  70.     public function getId(): ?int
  71.     {
  72.         return $this->id;
  73.     }
  74.     public function getName(): ?string
  75.     {
  76.         return $this->name;
  77.     }
  78.     public function setName(?string $name): self
  79.     {
  80.         $this->name $name;
  81.         return $this;
  82.     }
  83.     public function getStatus(): ?string
  84.     {
  85.         return $this->status;
  86.     }
  87.     public function setStatus(?string $status): self
  88.     {
  89.         $this->status $status;
  90.         return $this;
  91.     }
  92.     public function getMetaDescription(): ?string
  93.     {
  94.         return $this->metaDescription;
  95.     }
  96.     public function setMetaDescription(?string $metaDescription): self
  97.     {
  98.         $this->metaDescription $metaDescription;
  99.         return $this;
  100.     }
  101.     public function getMetaImg(): ?string
  102.     {
  103.         return $this->metaImg;
  104.     }
  105.     public function setMetaImg(?string $metaImg): self
  106.     {
  107.         $this->metaImg $metaImg;
  108.         return $this;
  109.     }
  110.     public function getJavascriptAdd(): ?string
  111.     {
  112.         return $this->javascriptAdd;
  113.     }
  114.     public function setJavascriptAdd(?string $javascriptAdd): self
  115.     {
  116.         $this->javascriptAdd $javascriptAdd;
  117.         return $this;
  118.     }
  119.     public function getCssAdd(): ?string
  120.     {
  121.         return $this->cssAdd;
  122.     }
  123.     public function setCssAdd(?string $cssAdd): self
  124.     {
  125.         $this->cssAdd $cssAdd;
  126.         return $this;
  127.     }
  128.     public function getContent(): ?string
  129.     {
  130.         return $this->content;
  131.     }
  132.     public function setContent(string $content): self
  133.     {
  134.         $this->content $content;
  135.         return $this;
  136.     }
  137.     public function getUrlAccess(): ?string
  138.     {
  139.         return $this->urlAccess;
  140.     }
  141.     public function setUrlAccess(string $urlAccess): self
  142.     {
  143.         $this->urlAccess $urlAccess;
  144.         return $this;
  145.     }
  146.     public function isIsActiv(): ?bool
  147.     {
  148.         return $this->is_activ;
  149.     }
  150.     public function setIsActiv(bool $is_activ): self
  151.     {
  152.         $this->is_activ $is_activ;
  153.         return $this;
  154.     }
  155.     public function isIsContact(): ?bool
  156.     {
  157.         return $this->is_contact;
  158.     }
  159.     public function setIsContact(bool $is_contact): self
  160.     {
  161.         $this->is_contact $is_contact;
  162.         return $this;
  163.     }
  164.     public function getDraft(): ?string
  165.     {
  166.         return $this->draft;
  167.     }
  168.     public function setDraft(?string $draft): self
  169.     {
  170.         $this->draft $draft;
  171.         return $this;
  172.     }
  173.     public function getTitle(): ?string
  174.     {
  175.         return $this->title;
  176.     }
  177.     public function setTitle(?string $title): self
  178.     {
  179.         $this->title $title;
  180.         return $this;
  181.     }
  182.     public function getSkeleton(): ?string
  183.     {
  184.         return $this->skeleton;
  185.     }
  186.     public function setSkeleton(?string $skeleton): static
  187.     {
  188.         $this->skeleton $skeleton;
  189.         return $this;
  190.     }
  191.     public function getHardComponent(): ?HardComponent
  192.     {
  193.         return $this->hardComponent;
  194.     }
  195.     public function setHardComponent(?HardComponent $hardComponent): static
  196.     {
  197.         $this->hardComponent $hardComponent;
  198.         return $this;
  199.     }
  200.     public function isIsHeaderComponent(): ?bool
  201.     {
  202.         return $this->is_headerComponent;
  203.     }
  204.     public function setIsHeaderComponent(?bool $is_headerComponent): static
  205.     {
  206.         $this->is_headerComponent $is_headerComponent;
  207.         return $this;
  208.     }
  209.     public function isIsNoIndex(): ?bool
  210.     {
  211.         return $this->is_noIndex;
  212.     }
  213.     public function setIsNoIndex(?bool $is_noIndex): static
  214.     {
  215.         $this->is_noIndex $is_noIndex;
  216.         return $this;
  217.     }
  218.     public function isIsHome(): ?bool
  219.     {
  220.         return $this->is_home;
  221.     }
  222.     public function setIsHome(?bool $is_home): static
  223.     {
  224.         $this->is_home $is_home;
  225.         return $this;
  226.     }
  227.     public function isIsLegal(): ?bool
  228.     {
  229.         return $this->is_legal;
  230.     }
  231.     public function setIsLegal(?bool $is_legal): static
  232.     {
  233.         $this->is_legal $is_legal;
  234.         return $this;
  235.     }
  236.     public function getcreatedAt(): ?\DateTimeInterface
  237.     {
  238.         return $this->created_at;
  239.     }
  240.     public function setCreatedAt(?\DateTimeInterface $created_at): static
  241.     {
  242.         $this->created_at $created_at;
  243.         return $this;
  244.     }
  245.     public function getUpdatedAt(): ?\DateTimeInterface
  246.     {
  247.         return $this->updated_at;
  248.     }
  249.     public function setUpdatedAt(?\DateTimeInterface $updated_at): static
  250.     {
  251.         $this->updated_at $updated_at;
  252.         return $this;
  253.     }
  254.     public function getPageType(): ?PageType
  255.     {
  256.         return $this->pageType;
  257.     }
  258.     public function setPageType(?PageType $pageType): static
  259.     {
  260.         $this->pageType $pageType;
  261.         return $this;
  262.     }
  263.     public function getVisibility(): ?string
  264.     {
  265.         return $this->visibility;
  266.     }
  267.     public function setVisibility(?string $visibility): static
  268.     {
  269.         $this->visibility $visibility;
  270.         return $this;
  271.     }
  272.     public function getReadingOrder(): ?int
  273.     {
  274.         return $this->readingOrder;
  275.     }
  276.     public function setReadingOrder(?int $readingOrder): static
  277.     {
  278.         $this->readingOrder $readingOrder;
  279.         return $this;
  280.     }
  281.     /**
  282.      * @return Collection<int, ContentGroupPage>
  283.      */
  284.     public function getContentGroupPages(): Collection
  285.     {
  286.         return $this->contentGroupPages;
  287.     }
  288.     public function addContentGroupPage(ContentGroupPage $contentGroupPage): static
  289.     {
  290.         if (!$this->contentGroupPages->contains($contentGroupPage)) {
  291.             $this->contentGroupPages->add($contentGroupPage);
  292.             $contentGroupPage->setPage($this);
  293.         }
  294.         return $this;
  295.     }
  296.     public function removeContentGroupPage(ContentGroupPage $contentGroupPage): static
  297.     {
  298.         if ($this->contentGroupPages->removeElement($contentGroupPage)) {
  299.             // set the owning side to null (unless already changed)
  300.             if ($contentGroupPage->getPage() === $this) {
  301.                 $contentGroupPage->setPage(null);
  302.             }
  303.         }
  304.         return $this;
  305.     }
  306.     public function getPublicUrl(): string
  307.     {
  308.         if ($this->pageType && $this->pageType->getSlug()) {
  309.             return '/t/' $this->pageType->getSlug() . '/' $this->urlAccess;
  310.         }
  311.         return '/page/' $this->urlAccess;
  312.     }
  313. }