<?php
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="home_page")
*/
class HomePage
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @var string $name
*
* @ORM\Column(type="string", nullable=true)
*/
protected $name;
/**
* @var string $slug
* @Gedmo\Slug(fields={"name"}, updatable=true, unique=true)
*
* @ORM\Column(type="string", nullable=true)
*/
protected $slug;
/**
* @var string $about_us_description
*
* @ORM\Column(type="text", nullable=true)
*/
protected $about_us_description;
/**
* @var string $about_us_image
*
* @ORM\ManyToOne(targetEntity="App\Entity\SonataMediaMedia", cascade = {"persist"})
* @ORM\JoinColumn(name="about_us_image_id", referencedColumnName="id", onDelete="SET NULL")
*/
protected $about_us_image;
/**
* @var string $doubts_url
*
* @ORM\Column(type="string", nullable=true)
*/
protected $doubts_url;
/**
* @var string $community_link
*
* @ORM\Column(type="string", nullable=true)
*/
protected $community_link;
/**
* @var string $community_banner
*
* @ORM\ManyToOne(targetEntity="App\Entity\SonataMediaMedia", cascade = {"persist"})
* @ORM\JoinColumn(name="community_banner_id", referencedColumnName="id", onDelete="SET NULL")
*/
protected $community_banner;
/**
* @var string $community_banner_mobile
*
* @ORM\ManyToOne(targetEntity="App\Entity\SonataMediaMedia", cascade = {"persist"})
* @ORM\JoinColumn(name="community_banner_mobile_id", referencedColumnName="id", onDelete="SET NULL")
*/
protected $community_banner_mobile;
/**
* @var string $wsp_image
*
* @ORM\ManyToOne(targetEntity="App\Entity\SonataMediaMedia", cascade = {"persist"})
* @ORM\JoinColumn(name="wsp_image_id", referencedColumnName="id", onDelete="SET NULL")
*/
protected $wsp_image;
/**
* @var string $wsp_image_mobile
*
* @ORM\ManyToOne(targetEntity="App\Entity\SonataMediaMedia", cascade = {"persist"})
* @ORM\JoinColumn(name="wsp_image_mobile_id", referencedColumnName="id", onDelete="SET NULL")
*/
protected $wsp_image_mobile;
/**
* @var string $wsp_url
*
* @ORM\Column(type="string", nullable=true)
*/
protected $wsp_url;
/**
* @var string $big_work_url
*
* @ORM\Column(type="string", nullable=true)
*/
protected $big_work_url;
/**
* @var string $big_work_image
*
* @ORM\ManyToOne(targetEntity="App\Entity\SonataMediaMedia", cascade = {"persist"})
* @ORM\JoinColumn(name="big_work_image_id", referencedColumnName="id", onDelete="SET NULL")
*/
protected $big_work_image;
/**
* @var string $big_work_image_mobile
*
* @ORM\ManyToOne(targetEntity="App\Entity\SonataMediaMedia", cascade = {"persist"})
* @ORM\JoinColumn(name="big_work_image_mobile_id", referencedColumnName="id", onDelete="SET NULL")
*/
protected $big_work_image_mobile;
/**
* @var string $ceap_image
*
* @ORM\ManyToOne(targetEntity="App\Entity\SonataMediaMedia", cascade = {"persist"})
* @ORM\JoinColumn(name="ceap_image_id", referencedColumnName="id", onDelete="SET NULL")
*/
protected $ceap_image;
/**
* @var string $ceap_image_mobile
*
* @ORM\ManyToOne(targetEntity="App\Entity\SonataMediaMedia", cascade = {"persist"})
* @ORM\JoinColumn(name="ceap_image_mobile_id", referencedColumnName="id", onDelete="SET NULL")
*/
protected $ceap_image_mobile;
/**
* @var string $doubts_image
*
* @ORM\ManyToOne(targetEntity="App\Entity\SonataMediaMedia", cascade = {"persist"})
* @ORM\JoinColumn(name="doubts_image_id", referencedColumnName="id", onDelete="SET NULL")
*/
protected $doubts_image;
/**
* @ORM\OneToMany(targetEntity = "App\Entity\HomeSlider", mappedBy="home_page", cascade={"persist"})
*/
protected $sliders;
/**
* @ORM\OneToMany(targetEntity = "App\Entity\HomeMkp", mappedBy="home_page", cascade={"persist"})
*/
protected $mkp_products;
/**
* @var string $video
*
* @ORM\ManyToOne(targetEntity="App\Entity\SonataMediaMedia", cascade = {"persist"})
* @ORM\JoinColumn(name="video_id", referencedColumnName="id", onDelete="SET NULL")
*/
protected $video;
/**
* @var string $video_image
*
* @ORM\ManyToOne(targetEntity="App\Entity\SonataMediaMedia", cascade = {"persist"})
* @ORM\JoinColumn(name="video_image_id", referencedColumnName="id", onDelete="SET NULL")
*/
protected $video_image;
/**
* @var \AppBundle\Entity\Seo $seo
*
* @ORM\ManyToOne(targetEntity="App\Entity\Seo", inversedBy="home_page")
* @ORM\JoinColumn(name="seo_id", referencedColumnName="id")
*/
private $seo;
/**
* @var string $create_at
*
* @Gedmo\Timestampable(on="create")
* @ORM\Column(type="datetime", nullable=true)
*/
protected $create_at;
/**
* @var string $update_at
*
* @Gedmo\Timestampable(on="update")
* @ORM\Column(type="datetime", nullable=true)
*/
protected $update_at;
public function __construct()
{
$this->sliders = new ArrayCollection();
$this->mkp_products = new ArrayCollection();
}
public function __toString()
{
return $this->name;
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): static
{
$this->name = $name;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(?string $slug): static
{
$this->slug = $slug;
return $this;
}
public function getAboutUsDescription(): ?string
{
return $this->about_us_description;
}
public function setAboutUsDescription(?string $about_us_description): static
{
$this->about_us_description = $about_us_description;
return $this;
}
public function getDoubtsUrl(): ?string
{
return $this->doubts_url;
}
public function setDoubtsUrl(?string $doubts_url): static
{
$this->doubts_url = $doubts_url;
return $this;
}
public function getCreateAt(): ?\DateTimeInterface
{
return $this->create_at;
}
public function setCreateAt(?\DateTimeInterface $create_at): static
{
$this->create_at = $create_at;
return $this;
}
public function getUpdateAt(): ?\DateTimeInterface
{
return $this->update_at;
}
public function setUpdateAt(?\DateTimeInterface $update_at): static
{
$this->update_at = $update_at;
return $this;
}
public function getAboutUsImage(): ?SonataMediaMedia
{
return $this->about_us_image;
}
public function setAboutUsImage(?SonataMediaMedia $about_us_image): static
{
$this->about_us_image = $about_us_image;
return $this;
}
public function getDoubtsImage(): ?SonataMediaMedia
{
return $this->doubts_image;
}
public function setDoubtsImage(?SonataMediaMedia $doubts_image): static
{
$this->doubts_image = $doubts_image;
return $this;
}
/**
* @return Collection<int, HomeSlider>
*/
public function getSliders(): Collection
{
return $this->sliders;
}
public function addSlider(HomeSlider $slider): static
{
if (!$this->sliders->contains($slider)) {
$this->sliders->add($slider);
$slider->setHomePage($this);
}
return $this;
}
public function removeSlider(HomeSlider $slider): static
{
if ($this->sliders->removeElement($slider)) {
// set the owning side to null (unless already changed)
if ($slider->getHomePage() === $this) {
$slider->setHomePage(null);
}
}
return $this;
}
/**
* @return Collection<int, HomeMkp>
*/
public function getMkpProducts(): Collection
{
return $this->mkp_products;
}
public function addMkpProduct(HomeMkp $mkpProduct): static
{
if (!$this->mkp_products->contains($mkpProduct)) {
$this->mkp_products->add($mkpProduct);
$mkpProduct->setHomePage($this);
}
return $this;
}
public function removeMkpProduct(HomeMkp $mkpProduct): static
{
if ($this->mkp_products->removeElement($mkpProduct)) {
// set the owning side to null (unless already changed)
if ($mkpProduct->getHomePage() === $this) {
$mkpProduct->setHomePage(null);
}
}
return $this;
}
public function getSeo(): ?Seo
{
return $this->seo;
}
public function setSeo(?Seo $seo): static
{
$this->seo = $seo;
return $this;
}
public function getWspUrl(): ?string
{
return $this->wsp_url;
}
public function setWspUrl(?string $wsp_url): static
{
$this->wsp_url = $wsp_url;
return $this;
}
public function getWspImage(): ?SonataMediaMedia
{
return $this->wsp_image;
}
public function setWspImage(?SonataMediaMedia $wsp_image): static
{
$this->wsp_image = $wsp_image;
return $this;
}
public function getWspImageMobile(): ?SonataMediaMedia
{
return $this->wsp_image_mobile;
}
public function setWspImageMobile(?SonataMediaMedia $wsp_image_mobile): static
{
$this->wsp_image_mobile = $wsp_image_mobile;
return $this;
}
public function getBigWorkUrl(): ?string
{
return $this->big_work_url;
}
public function setBigWorkUrl(?string $big_work_url): static
{
$this->big_work_url = $big_work_url;
return $this;
}
public function getBigWorkImage(): ?SonataMediaMedia
{
return $this->big_work_image;
}
public function setBigWorkImage(?SonataMediaMedia $big_work_image): static
{
$this->big_work_image = $big_work_image;
return $this;
}
public function getBigWorkImageMobile(): ?SonataMediaMedia
{
return $this->big_work_image_mobile;
}
public function setBigWorkImageMobile(?SonataMediaMedia $big_work_image_mobile): static
{
$this->big_work_image_mobile = $big_work_image_mobile;
return $this;
}
public function getCeapImage(): ?SonataMediaMedia
{
return $this->ceap_image;
}
public function setCeapImage(?SonataMediaMedia $ceap_image): static
{
$this->ceap_image = $ceap_image;
return $this;
}
public function getCeapImageMobile(): ?SonataMediaMedia
{
return $this->ceap_image_mobile;
}
public function setCeapImageMobile(?SonataMediaMedia $ceap_image_mobile): static
{
$this->ceap_image_mobile = $ceap_image_mobile;
return $this;
}
public function getVideo(): ?SonataMediaMedia
{
return $this->video;
}
public function setVideo(?SonataMediaMedia $video): static
{
$this->video = $video;
return $this;
}
public function getVideoImage(): ?SonataMediaMedia
{
return $this->video_image;
}
public function setVideoImage(?SonataMediaMedia $video_image): static
{
$this->video_image = $video_image;
return $this;
}
public function getCommunityLink(): ?string
{
return $this->community_link;
}
public function setCommunityLink(?string $community_link): static
{
$this->community_link = $community_link;
return $this;
}
public function getCommunityBanner(): ?SonataMediaMedia
{
return $this->community_banner;
}
public function setCommunityBanner(?SonataMediaMedia $community_banner): static
{
$this->community_banner = $community_banner;
return $this;
}
public function getCommunityBannerMobile(): ?SonataMediaMedia
{
return $this->community_banner_mobile;
}
public function setCommunityBannerMobile(?SonataMediaMedia $community_banner_mobile): static
{
$this->community_banner_mobile = $community_banner_mobile;
return $this;
}
}