src/Entity/HomeSlider.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\HomeSliderRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. //use Symfony\Bridge\Doctrine\Validator\Constraints as DoctrineAssert;
  8. use Gedmo\Mapping\Annotation as Gedmo;
  9. /**
  10.  * @ORM\Entity(repositoryClass=HomeSliderRepository::class)
  11.  * @ORM\Table(name="home_slider")
  12.  */
  13. class HomeSlider
  14. {
  15.     /**
  16.      * @ORM\Id
  17.      * @ORM\Column(type="integer")
  18.      * @ORM\GeneratedValue(strategy="AUTO")
  19.      */
  20.     protected $id;
  21.     /**
  22.     * @var boolean $public
  23.     *
  24.     * @ORM\Column(type="boolean", nullable=true)
  25.     */
  26.     protected $public;
  27.     /**
  28.      * @var string $name
  29.      *
  30.      * @ORM\Column(type="string", nullable=true)
  31.      */
  32.     protected $name;
  33.     /**
  34.      * @var string $slide_desktop
  35.      *
  36.      * @ORM\ManyToOne(targetEntity="App\Entity\SonataMediaMedia", cascade = {"persist"})
  37.      * @ORM\JoinColumn(name="slideDesktop_id", referencedColumnName="id", onDelete="SET NULL")
  38.      */
  39.     protected $slide_desktop;
  40.     /**
  41.      * @var string $banner_mobile
  42.      *
  43.      * @ORM\ManyToOne(targetEntity="App\Entity\SonataMediaMedia", cascade = {"persist"})
  44.      * @ORM\JoinColumn(name="banner_mobile_id", referencedColumnName="id", onDelete="SET NULL")
  45.      */
  46.     protected $banner_mobile;
  47.     /**
  48.      * @var string $link
  49.      *
  50.      * @ORM\Column(type="string", nullable=true)
  51.      */
  52.     protected $link;
  53.     /**
  54.      * @var string $target
  55.      *
  56.      * @ORM\Column(type="string", nullable=true)
  57.      */
  58.     protected $target;
  59.     /**
  60.      * @var string $title
  61.      *
  62.      * @ORM\Column(type="string", nullable=true)
  63.      */
  64.     protected $title;
  65.     /**
  66.      * @var string $body
  67.      *
  68.      * @ORM\Column(type="string", nullable=true)
  69.      */
  70.     protected $body;
  71.     /**
  72.      * @var boolean $local_link
  73.      *
  74.      * @ORM\Column(type="boolean", nullable=true)
  75.      */
  76.     protected $local_link;
  77.     /**
  78.      * @var string $style
  79.      *
  80.      * @ORM\Column(type="string", nullable=true)
  81.      */
  82.     protected $style;
  83.     /**
  84.      * @var \App\Entity\HomePage $home_page
  85.      *
  86.      * @ORM\ManyToOne(targetEntity="App\Entity\HomePage", inversedBy="sliders")
  87.      * @ORM\JoinColumn(name="home_page_id", referencedColumnName="id")
  88.      */
  89.     private $home_page;
  90.     /**
  91.      * @Gedmo\SortablePosition
  92.      * @var string $position
  93.      *
  94.      * @ORM\Column(type="integer", nullable=true)
  95.      */
  96.     protected $position;
  97.     /**
  98.      * @var string $create_at
  99.      *
  100.      * @Gedmo\Timestampable(on="create")
  101.      * @ORM\Column(type="datetime", nullable=true)
  102.      */
  103.     protected $create_at;
  104.     /**
  105.      * @var string $update_at
  106.      *
  107.      * @Gedmo\Timestampable(on="update")
  108.      * @ORM\Column(type="datetime", nullable=true)
  109.      */
  110.     protected $update_at;
  111.     public function __toString(): string
  112.     {
  113.         return $this->name;
  114.     }
  115.     public function getId(): ?int
  116.     {
  117.         return $this->id;
  118.     }
  119.     public function isPublic(): ?bool
  120.     {
  121.         return $this->public;
  122.     }
  123.     public function setPublic(?bool $public): static
  124.     {
  125.         $this->public $public;
  126.         return $this;
  127.     }
  128.     public function getName(): ?string
  129.     {
  130.         return $this->name;
  131.     }
  132.     public function setName(?string $name): static
  133.     {
  134.         $this->name $name;
  135.         return $this;
  136.     }
  137.     public function getLink(): ?string
  138.     {
  139.         return $this->link;
  140.     }
  141.     public function setLink(?string $link): static
  142.     {
  143.         $this->link $link;
  144.         return $this;
  145.     }
  146.     public function getTarget(): ?string
  147.     {
  148.         return $this->target;
  149.     }
  150.     public function setTarget(?string $target): static
  151.     {
  152.         $this->target $target;
  153.         return $this;
  154.     }
  155.     public function getTitle(): ?string
  156.     {
  157.         return $this->title;
  158.     }
  159.     public function setTitle(?string $title): static
  160.     {
  161.         $this->title $title;
  162.         return $this;
  163.     }
  164.     public function getBody(): ?string
  165.     {
  166.         return $this->body;
  167.     }
  168.     public function setBody(?string $body): static
  169.     {
  170.         $this->body $body;
  171.         return $this;
  172.     }
  173.     public function isLocalLink(): ?bool
  174.     {
  175.         return $this->local_link;
  176.     }
  177.     public function setLocalLink(?bool $local_link): static
  178.     {
  179.         $this->local_link $local_link;
  180.         return $this;
  181.     }
  182.     public function getStyle(): ?string
  183.     {
  184.         return $this->style;
  185.     }
  186.     public function setStyle(?string $style): static
  187.     {
  188.         $this->style $style;
  189.         return $this;
  190.     }
  191.     public function getPosition(): ?int
  192.     {
  193.         return $this->position;
  194.     }
  195.     public function setPosition(?int $position): static
  196.     {
  197.         $this->position $position;
  198.         return $this;
  199.     }
  200.     public function getCreateAt(): ?\DateTimeInterface
  201.     {
  202.         return $this->create_at;
  203.     }
  204.     public function setCreateAt(?\DateTimeInterface $create_at): static
  205.     {
  206.         $this->create_at $create_at;
  207.         return $this;
  208.     }
  209.     public function getUpdateAt(): ?\DateTimeInterface
  210.     {
  211.         return $this->update_at;
  212.     }
  213.     public function setUpdateAt(?\DateTimeInterface $update_at): static
  214.     {
  215.         $this->update_at $update_at;
  216.         return $this;
  217.     }
  218.     public function getSlideDesktop(): ?SonataMediaMedia
  219.     {
  220.         return $this->slide_desktop;
  221.     }
  222.     public function setSlideDesktop(?SonataMediaMedia $slide_desktop): static
  223.     {
  224.         $this->slide_desktop $slide_desktop;
  225.         return $this;
  226.     }
  227.     public function getBannerMobile(): ?SonataMediaMedia
  228.     {
  229.         return $this->banner_mobile;
  230.     }
  231.     public function setBannerMobile(?SonataMediaMedia $banner_mobile): static
  232.     {
  233.         $this->banner_mobile $banner_mobile;
  234.         return $this;
  235.     }
  236.     public function getHomePage(): ?HomePage
  237.     {
  238.         return $this->home_page;
  239.     }
  240.     public function setHomePage(?HomePage $home_page): static
  241.     {
  242.         $this->home_page $home_page;
  243.         return $this;
  244.     }
  245. }