src/Entity/HomeMkp.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_mkp")
  11.  */
  12. class HomeMkp
  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="mkp_products")
  56.     * @ORM\JoinColumn(name="home_page_id", referencedColumnName="id")
  57.     */
  58.     private $home_page;
  59.     /**
  60.     * @var string $create_at
  61.     *
  62.     * @Gedmo\Timestampable(on="create")
  63.     * @ORM\Column(type="datetime", nullable=true)
  64.     */
  65.     protected $create_at;
  66.     /**
  67.     * @var string $update_at
  68.     *
  69.     * @Gedmo\Timestampable(on="update")
  70.     * @ORM\Column(type="datetime", nullable=true)
  71.     */
  72.     protected $update_at;
  73.     public function __toString()
  74.     {
  75.         return $this->name;
  76.     }
  77.     public function getId(): ?int
  78.     {
  79.         return $this->id;
  80.     }
  81.     public function isIsPublic(): ?bool
  82.     {
  83.         return $this->is_public;
  84.     }
  85.     public function setIsPublic(?bool $is_public): static
  86.     {
  87.         $this->is_public $is_public;
  88.         return $this;
  89.     }
  90.     public function getName(): ?string
  91.     {
  92.         return $this->name;
  93.     }
  94.     public function setName(?string $name): static
  95.     {
  96.         $this->name $name;
  97.         return $this;
  98.     }
  99.     public function getUrl(): ?string
  100.     {
  101.         return $this->url;
  102.     }
  103.     public function setUrl(?string $url): static
  104.     {
  105.         $this->url $url;
  106.         return $this;
  107.     }
  108.     public function getCreateAt(): ?\DateTimeInterface
  109.     {
  110.         return $this->create_at;
  111.     }
  112.     public function setCreateAt(?\DateTimeInterface $create_at): static
  113.     {
  114.         $this->create_at $create_at;
  115.         return $this;
  116.     }
  117.     public function getUpdateAt(): ?\DateTimeInterface
  118.     {
  119.         return $this->update_at;
  120.     }
  121.     public function setUpdateAt(?\DateTimeInterface $update_at): static
  122.     {
  123.         $this->update_at $update_at;
  124.         return $this;
  125.     }
  126.     public function getImage(): ?SonataMediaMedia
  127.     {
  128.         return $this->image;
  129.     }
  130.     public function setImage(?SonataMediaMedia $image): static
  131.     {
  132.         $this->image $image;
  133.         return $this;
  134.     }
  135.     public function getImageMobile(): ?SonataMediaMedia
  136.     {
  137.         return $this->image_mobile;
  138.     }
  139.     public function setImageMobile(?SonataMediaMedia $image_mobile): static
  140.     {
  141.         $this->image_mobile $image_mobile;
  142.         return $this;
  143.     }
  144.     public function getHomePage(): ?HomePage
  145.     {
  146.         return $this->home_page;
  147.     }
  148.     public function setHomePage(?HomePage $home_page): static
  149.     {
  150.         $this->home_page $home_page;
  151.         return $this;
  152.     }
  153. }