<?php
namespace App\Entity;
use App\Repository\HomeSliderRepository;
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(repositoryClass=HomeSliderRepository::class)
* @ORM\Table(name="home_slider")
*/
class HomeSlider
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @var boolean $public
*
* @ORM\Column(type="boolean", nullable=true)
*/
protected $public;
/**
* @var string $name
*
* @ORM\Column(type="string", nullable=true)
*/
protected $name;
/**
* @var string $slide_desktop
*
* @ORM\ManyToOne(targetEntity="App\Entity\SonataMediaMedia", cascade = {"persist"})
* @ORM\JoinColumn(name="slideDesktop_id", referencedColumnName="id", onDelete="SET NULL")
*/
protected $slide_desktop;
/**
* @var string $banner_mobile
*
* @ORM\ManyToOne(targetEntity="App\Entity\SonataMediaMedia", cascade = {"persist"})
* @ORM\JoinColumn(name="banner_mobile_id", referencedColumnName="id", onDelete="SET NULL")
*/
protected $banner_mobile;
/**
* @var string $link
*
* @ORM\Column(type="string", nullable=true)
*/
protected $link;
/**
* @var string $target
*
* @ORM\Column(type="string", nullable=true)
*/
protected $target;
/**
* @var string $title
*
* @ORM\Column(type="string", nullable=true)
*/
protected $title;
/**
* @var string $body
*
* @ORM\Column(type="string", nullable=true)
*/
protected $body;
/**
* @var boolean $local_link
*
* @ORM\Column(type="boolean", nullable=true)
*/
protected $local_link;
/**
* @var string $style
*
* @ORM\Column(type="string", nullable=true)
*/
protected $style;
/**
* @var \App\Entity\HomePage $home_page
*
* @ORM\ManyToOne(targetEntity="App\Entity\HomePage", inversedBy="sliders")
* @ORM\JoinColumn(name="home_page_id", referencedColumnName="id")
*/
private $home_page;
/**
* @Gedmo\SortablePosition
* @var string $position
*
* @ORM\Column(type="integer", nullable=true)
*/
protected $position;
/**
* @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 __toString(): string
{
return $this->name;
}
public function getId(): ?int
{
return $this->id;
}
public function isPublic(): ?bool
{
return $this->public;
}
public function setPublic(?bool $public): static
{
$this->public = $public;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): static
{
$this->name = $name;
return $this;
}
public function getLink(): ?string
{
return $this->link;
}
public function setLink(?string $link): static
{
$this->link = $link;
return $this;
}
public function getTarget(): ?string
{
return $this->target;
}
public function setTarget(?string $target): static
{
$this->target = $target;
return $this;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(?string $title): static
{
$this->title = $title;
return $this;
}
public function getBody(): ?string
{
return $this->body;
}
public function setBody(?string $body): static
{
$this->body = $body;
return $this;
}
public function isLocalLink(): ?bool
{
return $this->local_link;
}
public function setLocalLink(?bool $local_link): static
{
$this->local_link = $local_link;
return $this;
}
public function getStyle(): ?string
{
return $this->style;
}
public function setStyle(?string $style): static
{
$this->style = $style;
return $this;
}
public function getPosition(): ?int
{
return $this->position;
}
public function setPosition(?int $position): static
{
$this->position = $position;
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 getSlideDesktop(): ?SonataMediaMedia
{
return $this->slide_desktop;
}
public function setSlideDesktop(?SonataMediaMedia $slide_desktop): static
{
$this->slide_desktop = $slide_desktop;
return $this;
}
public function getBannerMobile(): ?SonataMediaMedia
{
return $this->banner_mobile;
}
public function setBannerMobile(?SonataMediaMedia $banner_mobile): static
{
$this->banner_mobile = $banner_mobile;
return $this;
}
public function getHomePage(): ?HomePage
{
return $this->home_page;
}
public function setHomePage(?HomePage $home_page): static
{
$this->home_page = $home_page;
return $this;
}
}