src/Entity/Seo.php line 23

Open in your IDE?
  1. <?php
  2. /**
  3.  * Created by PhpStorm.
  4.  * User: mario
  5.  * Date: 28/06/2019
  6.  * Time: 22:35
  7.  */
  8. namespace App\Entity;
  9. use Doctrine\Common\Collections\ArrayCollection;
  10. use Doctrine\Common\Collections\Collection;
  11. use Doctrine\DBAL\Types\Types;
  12. use Doctrine\ORM\Mapping as ORM;
  13. use Symfony\Component\Validator\Constraints as Assert;
  14. use Symfony\Bridge\Doctrine\Validator\Constraints as DoctrineAssert;
  15. use Gedmo\Mapping\Annotation as Gedmo;
  16. /**
  17.  * @ORM\Entity
  18.  * @ORM\Table(name="seo")
  19.  */
  20. class Seo
  21. {
  22.     /**
  23.      * @ORM\Id
  24.      * @ORM\Column(type="integer")
  25.      * @ORM\GeneratedValue(strategy="AUTO")
  26.      */
  27.     protected $id;
  28.     /**
  29.      * @var string $title
  30.      *
  31.      * @ORM\Column(type="string", nullable=true)
  32.      */
  33.     protected $title;
  34.     /**
  35.      * @var string $keywords
  36.      *
  37.      * @ORM\Column(type="text", nullable=true)
  38.      */
  39.     protected $keywords;
  40.     /**
  41.      * @var string $description
  42.      *
  43.      * @ORM\Column(type="text", nullable=true)
  44.      */
  45.     protected $description;
  46.     /**
  47.      * @var string $share_image
  48.      *
  49.      * @ORM\ManyToOne(targetEntity="App\Entity\SonataMediaMedia", cascade = {"persist"})
  50.      * @ORM\JoinColumn(name="share_image_id", referencedColumnName="id", onDelete="SET NULL")
  51.      */
  52.     private $share_image;
  53.     /**
  54.     * @ORM\OneToMany(targetEntity = "App\Entity\HomePage", mappedBy="seo")
  55.     */
  56.     protected $home_page;
  57.     /**
  58.     * @ORM\OneToMany(targetEntity = "App\Entity\News", mappedBy="seo")
  59.     */
  60.     protected $news;
  61.     /**
  62.     * @ORM\OneToMany(targetEntity = "App\Entity\GeneralCategory", mappedBy="seo")
  63.     */
  64.     protected $general_category;
  65.     /**
  66.     * @ORM\OneToMany(targetEntity = "App\Entity\ProductCategory", mappedBy="seo")
  67.     */
  68.     protected $product_category;
  69.     /**
  70.     * @ORM\OneToMany(targetEntity = "App\Entity\Product", mappedBy="seo")
  71.     */
  72.     protected $products;
  73.     /**
  74.     * @ORM\OneToMany(targetEntity = "App\Entity\ManualsAndCatalogs", mappedBy="seo")
  75.     */
  76.     protected $manuals_and_catalogs;
  77.     /**
  78.     * @ORM\OneToMany(targetEntity = "App\Entity\BigWorks", mappedBy="seo")
  79.     */
  80.     protected $big_works;
  81.     /**
  82.     * @ORM\OneToMany(targetEntity = "App\Entity\BigWorkPage", mappedBy="seo")
  83.     */
  84.     protected $big_works_page;
  85.     /**
  86.     * @ORM\OneToMany(targetEntity = "App\Entity\ManualsAndCatalogsPage", mappedBy="seo")
  87.     */
  88.     protected $manuals_and_catalogs_page;
  89.     /**
  90.     * @ORM\OneToMany(targetEntity = "App\Entity\NewsPage", mappedBy="seo")
  91.     */
  92.     protected $news_page;
  93.     /**
  94.     * @ORM\OneToMany(targetEntity = "App\Entity\ProductsPage", mappedBy="seo")
  95.     */
  96.     protected $products_page;
  97.     /**
  98.     * @ORM\OneToMany(targetEntity = "App\Entity\SearchPage", mappedBy="seo")
  99.     */
  100.     protected $search_page;
  101.     /**
  102.     * @ORM\OneToMany(targetEntity = "App\Entity\UsPage", mappedBy="seo")
  103.     */
  104.     protected $us_page;
  105.     /**
  106.     * @ORM\OneToMany(targetEntity = "App\Entity\AboutPage", mappedBy="seo")
  107.     */
  108.     protected $about_page;
  109.     /**
  110.      * @var string $create_at
  111.      *
  112.      * @Gedmo\Timestampable(on="create")
  113.      * @ORM\Column(type="datetime", nullable=true)
  114.      */
  115.     protected $create_at;
  116.     public function __construct()
  117.     {
  118.         $this->home_page = new ArrayCollection();
  119.         $this->news = new ArrayCollection();
  120.         $this->general_category = new ArrayCollection();
  121.         $this->product_category = new ArrayCollection();
  122.         $this->products = new ArrayCollection();
  123.         $this->manuals_and_catalogs = new ArrayCollection();
  124.         $this->big_works = new ArrayCollection();
  125.         $this->big_works_page = new ArrayCollection();
  126.         $this->manuals_and_catalogs_page = new ArrayCollection();
  127.         $this->news_page = new ArrayCollection();
  128.         $this->products_page = new ArrayCollection();
  129.         $this->search_page = new ArrayCollection();
  130.         $this->us_page = new ArrayCollection();
  131.         $this->about_page = new ArrayCollection();
  132.     }
  133.     public function __toString(): string
  134.     {
  135.         return $this->title;
  136.     }
  137.     public function getId(): ?int
  138.     {
  139.         return $this->id;
  140.     }
  141.     public function getTitle(): ?string
  142.     {
  143.         return $this->title;
  144.     }
  145.     public function setTitle(?string $title): self
  146.     {
  147.         $this->title $title;
  148.         return $this;
  149.     }
  150.     public function getKeywords(): ?string
  151.     {
  152.         return $this->keywords;
  153.     }
  154.     public function setKeywords(?string $keywords): self
  155.     {
  156.         $this->keywords $keywords;
  157.         return $this;
  158.     }
  159.     public function getDescription(): ?string
  160.     {
  161.         return $this->description;
  162.     }
  163.     public function setDescription(?string $description): self
  164.     {
  165.         $this->description $description;
  166.         return $this;
  167.     }
  168.     public function getCreateAt(): ?\DateTimeInterface
  169.     {
  170.         return $this->create_at;
  171.     }
  172.     public function setCreateAt(?\DateTimeInterface $create_at): self
  173.     {
  174.         $this->create_at $create_at;
  175.         return $this;
  176.     }
  177.     public function getShareImage(): ?SonataMediaMedia
  178.     {
  179.         return $this->share_image;
  180.     }
  181.     public function setShareImage(?SonataMediaMedia $share_image): self
  182.     {
  183.         $this->share_image $share_image;
  184.         return $this;
  185.     }
  186.     /**
  187.      * @return Collection<int, HomePage>
  188.      */
  189.     public function getHomePage(): Collection
  190.     {
  191.         return $this->home_page;
  192.     }
  193.     public function addHomePage(HomePage $homePage): static
  194.     {
  195.         if (!$this->home_page->contains($homePage)) {
  196.             $this->home_page->add($homePage);
  197.             $homePage->setSeo($this);
  198.         }
  199.         return $this;
  200.     }
  201.     public function removeHomePage(HomePage $homePage): static
  202.     {
  203.         if ($this->home_page->removeElement($homePage)) {
  204.             // set the owning side to null (unless already changed)
  205.             if ($homePage->getSeo() === $this) {
  206.                 $homePage->setSeo(null);
  207.             }
  208.         }
  209.         return $this;
  210.     }
  211.     /**
  212.      * @return Collection<int, News>
  213.      */
  214.     public function getNews(): Collection
  215.     {
  216.         return $this->news;
  217.     }
  218.     public function addNews(News $news): static
  219.     {
  220.         if (!$this->news->contains($news)) {
  221.             $this->news->add($news);
  222.             $news->setSeo($this);
  223.         }
  224.         return $this;
  225.     }
  226.     public function removeNews(News $news): static
  227.     {
  228.         if ($this->news->removeElement($news)) {
  229.             // set the owning side to null (unless already changed)
  230.             if ($news->getSeo() === $this) {
  231.                 $news->setSeo(null);
  232.             }
  233.         }
  234.         return $this;
  235.     }
  236.     /**
  237.      * @return Collection<int, GeneralCategory>
  238.      */
  239.     public function getGeneralCategory(): Collection
  240.     {
  241.         return $this->general_category;
  242.     }
  243.     public function addGeneralCategory(GeneralCategory $generalCategory): static
  244.     {
  245.         if (!$this->general_category->contains($generalCategory)) {
  246.             $this->general_category->add($generalCategory);
  247.             $generalCategory->setSeo($this);
  248.         }
  249.         return $this;
  250.     }
  251.     public function removeGeneralCategory(GeneralCategory $generalCategory): static
  252.     {
  253.         if ($this->general_category->removeElement($generalCategory)) {
  254.             // set the owning side to null (unless already changed)
  255.             if ($generalCategory->getSeo() === $this) {
  256.                 $generalCategory->setSeo(null);
  257.             }
  258.         }
  259.         return $this;
  260.     }
  261.     /**
  262.      * @return Collection<int, ProductCategory>
  263.      */
  264.     public function getProductCategory(): Collection
  265.     {
  266.         return $this->product_category;
  267.     }
  268.     public function addProductCategory(ProductCategory $productCategory): static
  269.     {
  270.         if (!$this->product_category->contains($productCategory)) {
  271.             $this->product_category->add($productCategory);
  272.             $productCategory->setSeo($this);
  273.         }
  274.         return $this;
  275.     }
  276.     public function removeProductCategory(ProductCategory $productCategory): static
  277.     {
  278.         if ($this->product_category->removeElement($productCategory)) {
  279.             // set the owning side to null (unless already changed)
  280.             if ($productCategory->getSeo() === $this) {
  281.                 $productCategory->setSeo(null);
  282.             }
  283.         }
  284.         return $this;
  285.     }
  286.     /**
  287.      * @return Collection<int, Product>
  288.      */
  289.     public function getProducts(): Collection
  290.     {
  291.         return $this->products;
  292.     }
  293.     public function addProduct(Product $product): static
  294.     {
  295.         if (!$this->products->contains($product)) {
  296.             $this->products->add($product);
  297.             $product->setSeo($this);
  298.         }
  299.         return $this;
  300.     }
  301.     public function removeProduct(Product $product): static
  302.     {
  303.         if ($this->products->removeElement($product)) {
  304.             // set the owning side to null (unless already changed)
  305.             if ($product->getSeo() === $this) {
  306.                 $product->setSeo(null);
  307.             }
  308.         }
  309.         return $this;
  310.     }
  311.     /**
  312.      * @return Collection<int, ManualsAndCatalogs>
  313.      */
  314.     public function getManualsAndCatalogs(): Collection
  315.     {
  316.         return $this->manuals_and_catalogs;
  317.     }
  318.     public function addManualsAndCatalog(ManualsAndCatalogs $manualsAndCatalog): static
  319.     {
  320.         if (!$this->manuals_and_catalogs->contains($manualsAndCatalog)) {
  321.             $this->manuals_and_catalogs->add($manualsAndCatalog);
  322.             $manualsAndCatalog->setSeo($this);
  323.         }
  324.         return $this;
  325.     }
  326.     public function removeManualsAndCatalog(ManualsAndCatalogs $manualsAndCatalog): static
  327.     {
  328.         if ($this->manuals_and_catalogs->removeElement($manualsAndCatalog)) {
  329.             // set the owning side to null (unless already changed)
  330.             if ($manualsAndCatalog->getSeo() === $this) {
  331.                 $manualsAndCatalog->setSeo(null);
  332.             }
  333.         }
  334.         return $this;
  335.     }
  336.     /**
  337.      * @return Collection<int, BigWorks>
  338.      */
  339.     public function getBigWorks(): Collection
  340.     {
  341.         return $this->big_works;
  342.     }
  343.     public function addBigWork(BigWorks $bigWork): static
  344.     {
  345.         if (!$this->big_works->contains($bigWork)) {
  346.             $this->big_works->add($bigWork);
  347.             $bigWork->setSeo($this);
  348.         }
  349.         return $this;
  350.     }
  351.     public function removeBigWork(BigWorks $bigWork): static
  352.     {
  353.         if ($this->big_works->removeElement($bigWork)) {
  354.             // set the owning side to null (unless already changed)
  355.             if ($bigWork->getSeo() === $this) {
  356.                 $bigWork->setSeo(null);
  357.             }
  358.         }
  359.         return $this;
  360.     }
  361.     /**
  362.      * @return Collection<int, BigWorkPage>
  363.      */
  364.     public function getBigWorksPage(): Collection
  365.     {
  366.         return $this->big_works_page;
  367.     }
  368.     public function addBigWorksPage(BigWorkPage $bigWorksPage): static
  369.     {
  370.         if (!$this->big_works_page->contains($bigWorksPage)) {
  371.             $this->big_works_page->add($bigWorksPage);
  372.             $bigWorksPage->setSeo($this);
  373.         }
  374.         return $this;
  375.     }
  376.     public function removeBigWorksPage(BigWorkPage $bigWorksPage): static
  377.     {
  378.         if ($this->big_works_page->removeElement($bigWorksPage)) {
  379.             // set the owning side to null (unless already changed)
  380.             if ($bigWorksPage->getSeo() === $this) {
  381.                 $bigWorksPage->setSeo(null);
  382.             }
  383.         }
  384.         return $this;
  385.     }
  386.     /**
  387.      * @return Collection<int, ManualsAndCatalogsPage>
  388.      */
  389.     public function getManualsAndCatalogsPage(): Collection
  390.     {
  391.         return $this->manuals_and_catalogs_page;
  392.     }
  393.     public function addManualsAndCatalogsPage(ManualsAndCatalogsPage $manualsAndCatalogsPage): static
  394.     {
  395.         if (!$this->manuals_and_catalogs_page->contains($manualsAndCatalogsPage)) {
  396.             $this->manuals_and_catalogs_page->add($manualsAndCatalogsPage);
  397.             $manualsAndCatalogsPage->setSeo($this);
  398.         }
  399.         return $this;
  400.     }
  401.     public function removeManualsAndCatalogsPage(ManualsAndCatalogsPage $manualsAndCatalogsPage): static
  402.     {
  403.         if ($this->manuals_and_catalogs_page->removeElement($manualsAndCatalogsPage)) {
  404.             // set the owning side to null (unless already changed)
  405.             if ($manualsAndCatalogsPage->getSeo() === $this) {
  406.                 $manualsAndCatalogsPage->setSeo(null);
  407.             }
  408.         }
  409.         return $this;
  410.     }
  411.     /**
  412.      * @return Collection<int, NewsPage>
  413.      */
  414.     public function getNewsPage(): Collection
  415.     {
  416.         return $this->news_page;
  417.     }
  418.     public function addNewsPage(NewsPage $newsPage): static
  419.     {
  420.         if (!$this->news_page->contains($newsPage)) {
  421.             $this->news_page->add($newsPage);
  422.             $newsPage->setSeo($this);
  423.         }
  424.         return $this;
  425.     }
  426.     public function removeNewsPage(NewsPage $newsPage): static
  427.     {
  428.         if ($this->news_page->removeElement($newsPage)) {
  429.             // set the owning side to null (unless already changed)
  430.             if ($newsPage->getSeo() === $this) {
  431.                 $newsPage->setSeo(null);
  432.             }
  433.         }
  434.         return $this;
  435.     }
  436.     /**
  437.      * @return Collection<int, ProductsPage>
  438.      */
  439.     public function getProductsPage(): Collection
  440.     {
  441.         return $this->products_page;
  442.     }
  443.     public function addProductsPage(ProductsPage $productsPage): static
  444.     {
  445.         if (!$this->products_page->contains($productsPage)) {
  446.             $this->products_page->add($productsPage);
  447.             $productsPage->setSeo($this);
  448.         }
  449.         return $this;
  450.     }
  451.     public function removeProductsPage(ProductsPage $productsPage): static
  452.     {
  453.         if ($this->products_page->removeElement($productsPage)) {
  454.             // set the owning side to null (unless already changed)
  455.             if ($productsPage->getSeo() === $this) {
  456.                 $productsPage->setSeo(null);
  457.             }
  458.         }
  459.         return $this;
  460.     }
  461.     /**
  462.      * @return Collection<int, SearchPage>
  463.      */
  464.     public function getSearchPage(): Collection
  465.     {
  466.         return $this->search_page;
  467.     }
  468.     public function addSearchPage(SearchPage $searchPage): static
  469.     {
  470.         if (!$this->search_page->contains($searchPage)) {
  471.             $this->search_page->add($searchPage);
  472.             $searchPage->setSeo($this);
  473.         }
  474.         return $this;
  475.     }
  476.     public function removeSearchPage(SearchPage $searchPage): static
  477.     {
  478.         if ($this->search_page->removeElement($searchPage)) {
  479.             // set the owning side to null (unless already changed)
  480.             if ($searchPage->getSeo() === $this) {
  481.                 $searchPage->setSeo(null);
  482.             }
  483.         }
  484.         return $this;
  485.     }
  486.     /**
  487.      * @return Collection<int, UsPage>
  488.      */
  489.     public function getUsPage(): Collection
  490.     {
  491.         return $this->us_page;
  492.     }
  493.     public function addUsPage(UsPage $usPage): static
  494.     {
  495.         if (!$this->us_page->contains($usPage)) {
  496.             $this->us_page->add($usPage);
  497.             $usPage->setSeo($this);
  498.         }
  499.         return $this;
  500.     }
  501.     public function removeUsPage(UsPage $usPage): static
  502.     {
  503.         if ($this->us_page->removeElement($usPage)) {
  504.             // set the owning side to null (unless already changed)
  505.             if ($usPage->getSeo() === $this) {
  506.                 $usPage->setSeo(null);
  507.             }
  508.         }
  509.         return $this;
  510.     }
  511.     /**
  512.      * @return Collection<int, AboutPage>
  513.      */
  514.     public function getAboutPage(): Collection
  515.     {
  516.         return $this->about_page;
  517.     }
  518.     public function addAboutPage(AboutPage $aboutPage): static
  519.     {
  520.         if (!$this->about_page->contains($aboutPage)) {
  521.             $this->about_page->add($aboutPage);
  522.             $aboutPage->setSeo($this);
  523.         }
  524.         return $this;
  525.     }
  526.     public function removeAboutPage(AboutPage $aboutPage): static
  527.     {
  528.         if ($this->about_page->removeElement($aboutPage)) {
  529.             // set the owning side to null (unless already changed)
  530.             if ($aboutPage->getSeo() === $this) {
  531.                 $aboutPage->setSeo(null);
  532.             }
  533.         }
  534.         return $this;
  535.     }
  536. }