<?php
/**
* Created by PhpStorm.
* User: mario
* Date: 28/06/2019
* Time: 22:35
*/
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Bridge\Doctrine\Validator\Constraints as DoctrineAssert;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Entity
* @ORM\Table(name="seo")
*/
class Seo
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @var string $title
*
* @ORM\Column(type="string", nullable=true)
*/
protected $title;
/**
* @var string $keywords
*
* @ORM\Column(type="text", nullable=true)
*/
protected $keywords;
/**
* @var string $description
*
* @ORM\Column(type="text", nullable=true)
*/
protected $description;
/**
* @var string $share_image
*
* @ORM\ManyToOne(targetEntity="App\Entity\SonataMediaMedia", cascade = {"persist"})
* @ORM\JoinColumn(name="share_image_id", referencedColumnName="id", onDelete="SET NULL")
*/
private $share_image;
/**
* @ORM\OneToMany(targetEntity = "App\Entity\HomePage", mappedBy="seo")
*/
protected $home_page;
/**
* @ORM\OneToMany(targetEntity = "App\Entity\News", mappedBy="seo")
*/
protected $news;
/**
* @ORM\OneToMany(targetEntity = "App\Entity\GeneralCategory", mappedBy="seo")
*/
protected $general_category;
/**
* @ORM\OneToMany(targetEntity = "App\Entity\ProductCategory", mappedBy="seo")
*/
protected $product_category;
/**
* @ORM\OneToMany(targetEntity = "App\Entity\Product", mappedBy="seo")
*/
protected $products;
/**
* @ORM\OneToMany(targetEntity = "App\Entity\ManualsAndCatalogs", mappedBy="seo")
*/
protected $manuals_and_catalogs;
/**
* @ORM\OneToMany(targetEntity = "App\Entity\BigWorks", mappedBy="seo")
*/
protected $big_works;
/**
* @ORM\OneToMany(targetEntity = "App\Entity\BigWorkPage", mappedBy="seo")
*/
protected $big_works_page;
/**
* @ORM\OneToMany(targetEntity = "App\Entity\ManualsAndCatalogsPage", mappedBy="seo")
*/
protected $manuals_and_catalogs_page;
/**
* @ORM\OneToMany(targetEntity = "App\Entity\NewsPage", mappedBy="seo")
*/
protected $news_page;
/**
* @ORM\OneToMany(targetEntity = "App\Entity\ProductsPage", mappedBy="seo")
*/
protected $products_page;
/**
* @ORM\OneToMany(targetEntity = "App\Entity\SearchPage", mappedBy="seo")
*/
protected $search_page;
/**
* @ORM\OneToMany(targetEntity = "App\Entity\UsPage", mappedBy="seo")
*/
protected $us_page;
/**
* @ORM\OneToMany(targetEntity = "App\Entity\AboutPage", mappedBy="seo")
*/
protected $about_page;
/**
* @var string $create_at
*
* @Gedmo\Timestampable(on="create")
* @ORM\Column(type="datetime", nullable=true)
*/
protected $create_at;
public function __construct()
{
$this->home_page = new ArrayCollection();
$this->news = new ArrayCollection();
$this->general_category = new ArrayCollection();
$this->product_category = new ArrayCollection();
$this->products = new ArrayCollection();
$this->manuals_and_catalogs = new ArrayCollection();
$this->big_works = new ArrayCollection();
$this->big_works_page = new ArrayCollection();
$this->manuals_and_catalogs_page = new ArrayCollection();
$this->news_page = new ArrayCollection();
$this->products_page = new ArrayCollection();
$this->search_page = new ArrayCollection();
$this->us_page = new ArrayCollection();
$this->about_page = new ArrayCollection();
}
public function __toString(): string
{
return $this->title;
}
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(?string $title): self
{
$this->title = $title;
return $this;
}
public function getKeywords(): ?string
{
return $this->keywords;
}
public function setKeywords(?string $keywords): self
{
$this->keywords = $keywords;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getCreateAt(): ?\DateTimeInterface
{
return $this->create_at;
}
public function setCreateAt(?\DateTimeInterface $create_at): self
{
$this->create_at = $create_at;
return $this;
}
public function getShareImage(): ?SonataMediaMedia
{
return $this->share_image;
}
public function setShareImage(?SonataMediaMedia $share_image): self
{
$this->share_image = $share_image;
return $this;
}
/**
* @return Collection<int, HomePage>
*/
public function getHomePage(): Collection
{
return $this->home_page;
}
public function addHomePage(HomePage $homePage): static
{
if (!$this->home_page->contains($homePage)) {
$this->home_page->add($homePage);
$homePage->setSeo($this);
}
return $this;
}
public function removeHomePage(HomePage $homePage): static
{
if ($this->home_page->removeElement($homePage)) {
// set the owning side to null (unless already changed)
if ($homePage->getSeo() === $this) {
$homePage->setSeo(null);
}
}
return $this;
}
/**
* @return Collection<int, News>
*/
public function getNews(): Collection
{
return $this->news;
}
public function addNews(News $news): static
{
if (!$this->news->contains($news)) {
$this->news->add($news);
$news->setSeo($this);
}
return $this;
}
public function removeNews(News $news): static
{
if ($this->news->removeElement($news)) {
// set the owning side to null (unless already changed)
if ($news->getSeo() === $this) {
$news->setSeo(null);
}
}
return $this;
}
/**
* @return Collection<int, GeneralCategory>
*/
public function getGeneralCategory(): Collection
{
return $this->general_category;
}
public function addGeneralCategory(GeneralCategory $generalCategory): static
{
if (!$this->general_category->contains($generalCategory)) {
$this->general_category->add($generalCategory);
$generalCategory->setSeo($this);
}
return $this;
}
public function removeGeneralCategory(GeneralCategory $generalCategory): static
{
if ($this->general_category->removeElement($generalCategory)) {
// set the owning side to null (unless already changed)
if ($generalCategory->getSeo() === $this) {
$generalCategory->setSeo(null);
}
}
return $this;
}
/**
* @return Collection<int, ProductCategory>
*/
public function getProductCategory(): Collection
{
return $this->product_category;
}
public function addProductCategory(ProductCategory $productCategory): static
{
if (!$this->product_category->contains($productCategory)) {
$this->product_category->add($productCategory);
$productCategory->setSeo($this);
}
return $this;
}
public function removeProductCategory(ProductCategory $productCategory): static
{
if ($this->product_category->removeElement($productCategory)) {
// set the owning side to null (unless already changed)
if ($productCategory->getSeo() === $this) {
$productCategory->setSeo(null);
}
}
return $this;
}
/**
* @return Collection<int, Product>
*/
public function getProducts(): Collection
{
return $this->products;
}
public function addProduct(Product $product): static
{
if (!$this->products->contains($product)) {
$this->products->add($product);
$product->setSeo($this);
}
return $this;
}
public function removeProduct(Product $product): static
{
if ($this->products->removeElement($product)) {
// set the owning side to null (unless already changed)
if ($product->getSeo() === $this) {
$product->setSeo(null);
}
}
return $this;
}
/**
* @return Collection<int, ManualsAndCatalogs>
*/
public function getManualsAndCatalogs(): Collection
{
return $this->manuals_and_catalogs;
}
public function addManualsAndCatalog(ManualsAndCatalogs $manualsAndCatalog): static
{
if (!$this->manuals_and_catalogs->contains($manualsAndCatalog)) {
$this->manuals_and_catalogs->add($manualsAndCatalog);
$manualsAndCatalog->setSeo($this);
}
return $this;
}
public function removeManualsAndCatalog(ManualsAndCatalogs $manualsAndCatalog): static
{
if ($this->manuals_and_catalogs->removeElement($manualsAndCatalog)) {
// set the owning side to null (unless already changed)
if ($manualsAndCatalog->getSeo() === $this) {
$manualsAndCatalog->setSeo(null);
}
}
return $this;
}
/**
* @return Collection<int, BigWorks>
*/
public function getBigWorks(): Collection
{
return $this->big_works;
}
public function addBigWork(BigWorks $bigWork): static
{
if (!$this->big_works->contains($bigWork)) {
$this->big_works->add($bigWork);
$bigWork->setSeo($this);
}
return $this;
}
public function removeBigWork(BigWorks $bigWork): static
{
if ($this->big_works->removeElement($bigWork)) {
// set the owning side to null (unless already changed)
if ($bigWork->getSeo() === $this) {
$bigWork->setSeo(null);
}
}
return $this;
}
/**
* @return Collection<int, BigWorkPage>
*/
public function getBigWorksPage(): Collection
{
return $this->big_works_page;
}
public function addBigWorksPage(BigWorkPage $bigWorksPage): static
{
if (!$this->big_works_page->contains($bigWorksPage)) {
$this->big_works_page->add($bigWorksPage);
$bigWorksPage->setSeo($this);
}
return $this;
}
public function removeBigWorksPage(BigWorkPage $bigWorksPage): static
{
if ($this->big_works_page->removeElement($bigWorksPage)) {
// set the owning side to null (unless already changed)
if ($bigWorksPage->getSeo() === $this) {
$bigWorksPage->setSeo(null);
}
}
return $this;
}
/**
* @return Collection<int, ManualsAndCatalogsPage>
*/
public function getManualsAndCatalogsPage(): Collection
{
return $this->manuals_and_catalogs_page;
}
public function addManualsAndCatalogsPage(ManualsAndCatalogsPage $manualsAndCatalogsPage): static
{
if (!$this->manuals_and_catalogs_page->contains($manualsAndCatalogsPage)) {
$this->manuals_and_catalogs_page->add($manualsAndCatalogsPage);
$manualsAndCatalogsPage->setSeo($this);
}
return $this;
}
public function removeManualsAndCatalogsPage(ManualsAndCatalogsPage $manualsAndCatalogsPage): static
{
if ($this->manuals_and_catalogs_page->removeElement($manualsAndCatalogsPage)) {
// set the owning side to null (unless already changed)
if ($manualsAndCatalogsPage->getSeo() === $this) {
$manualsAndCatalogsPage->setSeo(null);
}
}
return $this;
}
/**
* @return Collection<int, NewsPage>
*/
public function getNewsPage(): Collection
{
return $this->news_page;
}
public function addNewsPage(NewsPage $newsPage): static
{
if (!$this->news_page->contains($newsPage)) {
$this->news_page->add($newsPage);
$newsPage->setSeo($this);
}
return $this;
}
public function removeNewsPage(NewsPage $newsPage): static
{
if ($this->news_page->removeElement($newsPage)) {
// set the owning side to null (unless already changed)
if ($newsPage->getSeo() === $this) {
$newsPage->setSeo(null);
}
}
return $this;
}
/**
* @return Collection<int, ProductsPage>
*/
public function getProductsPage(): Collection
{
return $this->products_page;
}
public function addProductsPage(ProductsPage $productsPage): static
{
if (!$this->products_page->contains($productsPage)) {
$this->products_page->add($productsPage);
$productsPage->setSeo($this);
}
return $this;
}
public function removeProductsPage(ProductsPage $productsPage): static
{
if ($this->products_page->removeElement($productsPage)) {
// set the owning side to null (unless already changed)
if ($productsPage->getSeo() === $this) {
$productsPage->setSeo(null);
}
}
return $this;
}
/**
* @return Collection<int, SearchPage>
*/
public function getSearchPage(): Collection
{
return $this->search_page;
}
public function addSearchPage(SearchPage $searchPage): static
{
if (!$this->search_page->contains($searchPage)) {
$this->search_page->add($searchPage);
$searchPage->setSeo($this);
}
return $this;
}
public function removeSearchPage(SearchPage $searchPage): static
{
if ($this->search_page->removeElement($searchPage)) {
// set the owning side to null (unless already changed)
if ($searchPage->getSeo() === $this) {
$searchPage->setSeo(null);
}
}
return $this;
}
/**
* @return Collection<int, UsPage>
*/
public function getUsPage(): Collection
{
return $this->us_page;
}
public function addUsPage(UsPage $usPage): static
{
if (!$this->us_page->contains($usPage)) {
$this->us_page->add($usPage);
$usPage->setSeo($this);
}
return $this;
}
public function removeUsPage(UsPage $usPage): static
{
if ($this->us_page->removeElement($usPage)) {
// set the owning side to null (unless already changed)
if ($usPage->getSeo() === $this) {
$usPage->setSeo(null);
}
}
return $this;
}
/**
* @return Collection<int, AboutPage>
*/
public function getAboutPage(): Collection
{
return $this->about_page;
}
public function addAboutPage(AboutPage $aboutPage): static
{
if (!$this->about_page->contains($aboutPage)) {
$this->about_page->add($aboutPage);
$aboutPage->setSeo($this);
}
return $this;
}
public function removeAboutPage(AboutPage $aboutPage): static
{
if ($this->about_page->removeElement($aboutPage)) {
// set the owning side to null (unless already changed)
if ($aboutPage->getSeo() === $this) {
$aboutPage->setSeo(null);
}
}
return $this;
}
}