src/Entity/SeoPage.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SeoPageRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\HttpFoundation\File\File;
  8. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  9. /** @Vich\Uploadable
  10.  */
  11. #[ORM\Entity(repositoryClassSeoPageRepository::class)]
  12. class SeoPage
  13. {
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column(type'integer')]
  17.     private $id;
  18.     #[ORM\Column(type'string'length255nullabletrue)]
  19.     private $name;
  20. #[ORM\Column(type'string'length255nullabletrue)]
  21.     private $default_title;
  22. #[ORM\Column(type'string'length255nullabletrue)]
  23.     private $default_descripion;
  24.     #[ORM\Column(type'string'length255nullabletrue)]
  25.     private $template;
  26.     #[ORM\Column(type'text'length255nullabletrue)]
  27.     private $page_title;
  28.     #[ORM\Column(type'text'nullabletrue)]
  29.     private $page_descripion;
  30.     #[ORM\Column(type'string'length255nullabletrue)]
  31.     private $page_media;
  32.     #[ORM\Column(type'text'nullabletrue)]
  33.     private $services_title;
  34.     #[ORM\Column(type'text'nullabletrue)]
  35.     private $services_description;
  36.    
  37.    
  38.     #[ORM\Column(type'string'length255nullabletrue)]
  39.     private $page_video;
  40.     #[ORM\OneToMany(targetEntityPageService::class, mappedBy'seopage'orphanRemovaltruecascade: ['persist''remove'])]
  41.     private $pageServices;
  42.   /**
  43.      * @Vich\UploadableField(mapping="services_medias", fileNameProperty="page_media")
  44.      * @var File|null
  45.      */
  46.     private $Tmppagemedia null;
  47.     #[ORM\ManyToOne(targetEntityTypeSeoPage::class, inversedBy'seoPages')]
  48.     #[ORM\JoinColumn(nullablefalse)]
  49.     private $type;
  50.     #[ORM\Column(type'datetime'nullabletrue)]
  51.     private $updatedAt;
  52.     public function __construct()
  53.     {
  54.         $this->pageServices = new ArrayCollection();
  55.     }
  56.     public function getId(): ?int
  57.     {
  58.         return $this->id;
  59.     }
  60.     public function getName(): ?string
  61.     {
  62.         return $this->name;
  63.     }
  64.     public function setName(string $name): self
  65.     {
  66.         $this->name $name;
  67.         return $this;
  68.     }
  69.     public function getDefaultTitle(): ?string
  70.     {
  71.         return $this->default_title;
  72.     }
  73.     public function setDefaultTitle(?string $default_title): self
  74.     {
  75.         $this->default_title $default_title;
  76.         return $this;
  77.     }
  78.     public function getDefaultDescripion(): ?string
  79.     {
  80.         return $this->default_descripion;
  81.     }
  82.     public function setDefaultDescripion(?string $default_descripion): self
  83.     {
  84.         $this->default_descripion $default_descripion;
  85.         return $this;
  86.     }
  87.     public function getTemplate(): ?string
  88.     {
  89.         return $this->template;
  90.     }
  91.     public function setTemplate(?string $template): self
  92.     {
  93.         $this->template $template;
  94.         return $this;
  95.     }
  96.   
  97.     public function getPageTitle(): ?string
  98.     {
  99.         return $this->page_title;
  100.     }
  101.     public function setPageTitle(?string $page_title): self
  102.     {
  103.         $this->page_title $page_title;
  104.         return $this;
  105.     }
  106.     public function getPageDescripion(): ?string
  107.     {
  108.         return $this->page_descripion;
  109.     }
  110.     public function setPageDescripion(?string $page_descripion): self
  111.     {
  112.         $this->page_descripion $page_descripion;
  113.         return $this;
  114.     }
  115.     public function getPageMedia(): ?string
  116.     {
  117.         return $this->page_media;
  118.     }
  119.     public function setPageMedia(?string $page_media): self
  120.     {
  121.         $this->page_media $page_media;
  122.         return $this;
  123.     }
  124.     public function getServicesTitle(): ?string
  125.     {
  126.         return $this->services_title;
  127.     }
  128.     public function setServicesTitle(?string $services_title): self
  129.     {
  130.         $this->services_title $services_title;
  131.         return $this;
  132.     }
  133.     public function getServicesDescription(): ?string
  134.     {
  135.         return $this->services_description;
  136.     }
  137.     public function setServicesDescription(?string $services_description): self
  138.     {
  139.         $this->services_description $services_description;
  140.         return $this;
  141.     }
  142.    
  143.   
  144.     public function getPageVideo(): ?string
  145.     {
  146.         return $this->page_video;
  147.     }
  148.     public function setPageVideo(string $page_video): self
  149.     {
  150.         $this->page_video $page_video;
  151.         return $this;
  152.     }
  153.     /**
  154.      * @return Collection|PageService[]
  155.      */
  156.     public function getPageServices(): Collection
  157.     {
  158.        // var_dump($this->pageServices);exit;
  159.         return $this->pageServices;
  160.     }
  161.     public function addPageService(PageService $pageService): self
  162.     {
  163.         if (!$this->pageServices->contains($pageService)) {
  164.             $this->pageServices[] = $pageService;
  165.             $pageService->setSeopage($this);
  166.         }
  167.         return $this;
  168.     }
  169.     public function removePageService(PageService $pageService): self
  170.     {
  171.         if ($this->pageServices->removeElement($pageService)) {
  172.             // set the owning side to null (unless already changed)
  173.             if ($pageService->getSeopage() === $this) {
  174.                 $pageService->setSeopage(null);
  175.             }
  176.         }
  177.         return $this;
  178.     }
  179.       public function setTmpPageMedia(?File $Tmppagemedia null): void
  180.     {
  181.         $this->Tmppagemedia $Tmppagemedia;
  182.     if ($Tmppagemedia) {
  183.             $this->updatedAt = new \DateTime('now');
  184.         }
  185.     }
  186.     public function getTmpPageMedia() : ?File
  187.     {
  188.         return $this->Tmppagemedia;
  189.     }
  190.     public function getType(): ?TypeSeoPage
  191.     {
  192.         return $this->type;
  193.     }
  194.     public function setType(?TypeSeoPage $type): self
  195.     {
  196.         $this->type $type;
  197.         return $this;
  198.     }
  199.     public function getUpdatedAt(): ?\DateTimeInterface
  200.     {
  201.         return $this->updatedAt;
  202.     }
  203.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  204.     {
  205.         $this->updatedAt $updatedAt;
  206.         return $this;
  207.     }
  208. }