src/Entity/HomeSlider.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\DBAL\Types\Types;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. //use Symfony\Bridge\Doctrine\Validator\Constraints as DoctrineAssert;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. /**
  9.  * @ORM\Entity
  10.  * @ORM\Table(name="home_slider")
  11.  */
  12. class HomeSlider
  13. {
  14.     /**
  15.     * @ORM\Id
  16.     * @ORM\Column(type="integer")
  17.     * @ORM\GeneratedValue(strategy="AUTO")
  18.     */
  19.     protected $id;
  20.     /**
  21.     * @var boolean $is_public
  22.     *
  23.     * @ORM\Column(type="boolean", nullable=true)
  24.     */
  25.     protected $is_public;
  26.     /**
  27.     * @var string $name
  28.     *
  29.     * @ORM\Column(type="string", nullable=true)
  30.     */
  31.     protected $name;
  32.     /**
  33.     * @var string $image
  34.     *
  35.     * @ORM\ManyToOne(targetEntity="App\Entity\SonataMediaMedia", cascade = {"persist"})
  36.     * @ORM\JoinColumn(name="image_id", referencedColumnName="id", onDelete="SET NULL")
  37.     */
  38.     protected $image;
  39.     /**
  40.     * @var string $image_mobile
  41.     *
  42.     * @ORM\ManyToOne(targetEntity="App\Entity\SonataMediaMedia", cascade = {"persist"})
  43.     * @ORM\JoinColumn(name="image_mobile_id", referencedColumnName="id", onDelete="SET NULL")
  44.     */
  45.     protected $image_mobile;
  46.     /**
  47.     * @var string $url
  48.     *
  49.     * @ORM\Column(type="string", nullable=true)
  50.     */
  51.     protected $url;
  52.     /**
  53.     * @var \AppBundle\Entity\HomePage $home_page
  54.     *
  55.     * @ORM\ManyToOne(targetEntity="App\Entity\HomePage", inversedBy="sliders")
  56.     * @ORM\JoinColumn(name="home_page_id", referencedColumnName="id")
  57.     */
  58.     private $home_page;
  59.     /**
  60.      * @Gedmo\SortablePosition
  61.      * @var string $position
  62.      *
  63.      * @ORM\Column(type="integer", nullable=true)
  64.      */
  65.     protected $position;
  66.     /**
  67.     * @var string $create_at
  68.     *
  69.     * @Gedmo\Timestampable(on="create")
  70.     * @ORM\Column(type="datetime", nullable=true)
  71.     */
  72.     protected $create_at;
  73.     /**
  74.     * @var string $update_at
  75.     *
  76.     * @Gedmo\Timestampable(on="update")
  77.     * @ORM\Column(type="datetime", nullable=true)
  78.     */
  79.     protected $update_at;
  80.     public function __toString()
  81.     {
  82.         return $this->name;
  83.     }
  84.     public function getId(): ?int
  85.     {
  86.         return $this->id;
  87.     }
  88.     public function isIsPublic(): ?bool
  89.     {
  90.         return $this->is_public;
  91.     }
  92.     public function setIsPublic(?bool $is_public): static
  93.     {
  94.         $this->is_public $is_public;
  95.         return $this;
  96.     }
  97.     public function getName(): ?string
  98.     {
  99.         return $this->name;
  100.     }
  101.     public function setName(?string $name): static
  102.     {
  103.         $this->name $name;
  104.         return $this;
  105.     }
  106.     public function getUrl(): ?string
  107.     {
  108.         return $this->url;
  109.     }
  110.     public function setUrl(?string $url): static
  111.     {
  112.         $this->url $url;
  113.         return $this;
  114.     }
  115.     public function getPosition(): ?int
  116.     {
  117.         return $this->position;
  118.     }
  119.     public function setPosition(?int $position): static
  120.     {
  121.         $this->position $position;
  122.         return $this;
  123.     }
  124.     public function getCreateAt(): ?\DateTimeInterface
  125.     {
  126.         return $this->create_at;
  127.     }
  128.     public function setCreateAt(?\DateTimeInterface $create_at): static
  129.     {
  130.         $this->create_at $create_at;
  131.         return $this;
  132.     }
  133.     public function getUpdateAt(): ?\DateTimeInterface
  134.     {
  135.         return $this->update_at;
  136.     }
  137.     public function setUpdateAt(?\DateTimeInterface $update_at): static
  138.     {
  139.         $this->update_at $update_at;
  140.         return $this;
  141.     }
  142.     public function getImage(): ?SonataMediaMedia
  143.     {
  144.         return $this->image;
  145.     }
  146.     public function setImage(?SonataMediaMedia $image): static
  147.     {
  148.         $this->image $image;
  149.         return $this;
  150.     }
  151.     public function getImageMobile(): ?SonataMediaMedia
  152.     {
  153.         return $this->image_mobile;
  154.     }
  155.     public function setImageMobile(?SonataMediaMedia $image_mobile): static
  156.     {
  157.         $this->image_mobile $image_mobile;
  158.         return $this;
  159.     }
  160.     public function getHomePage(): ?HomePage
  161.     {
  162.         return $this->home_page;
  163.     }
  164.     public function setHomePage(?HomePage $home_page): static
  165.     {
  166.         $this->home_page $home_page;
  167.         return $this;
  168.     }
  169. }