src/Entity/NewsPage.php line 14

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="news_page")
  11.  */
  12. class NewsPage
  13. {
  14.     /**
  15.     * @ORM\Id
  16.     * @ORM\Column(type="integer")
  17.     * @ORM\GeneratedValue(strategy="AUTO")
  18.     */
  19.     protected $id;
  20.     /**
  21.     * @var string $name
  22.     *
  23.     * @ORM\Column(type="string", nullable=true)
  24.     */
  25.     protected $name;
  26.     /**
  27.      * @var string $slug
  28.      * @Gedmo\Slug(fields={"name"}, updatable=true, unique=true)
  29.      *
  30.      * @ORM\Column(type="string", nullable=true)
  31.      */
  32.     protected $slug;
  33.     /**
  34.      * @var string $image
  35.      *
  36.      * @ORM\ManyToOne(targetEntity="App\Entity\SonataMediaMedia", cascade = {"persist"})
  37.      * @ORM\JoinColumn(name="image_id", referencedColumnName="id", onDelete="SET NULL")
  38.      */
  39.     protected $image;
  40.     /**
  41.      * @var string $image_mobile
  42.      *
  43.      * @ORM\ManyToOne(targetEntity="App\Entity\SonataMediaMedia", cascade = {"persist"})
  44.      * @ORM\JoinColumn(name="image_mobile_id", referencedColumnName="id", onDelete="SET NULL")
  45.      */
  46.     protected $image_mobile;
  47.     /**
  48.     * @var \App\Entity\Seo $seo
  49.     *
  50.     * @ORM\ManyToOne(targetEntity="App\Entity\Seo", inversedBy="news_page")
  51.     * @ORM\JoinColumn(name="seo_id", referencedColumnName="id")
  52.     */
  53.     private $seo;
  54.     /**
  55.      * @var string $create_at
  56.      *
  57.      * @Gedmo\Timestampable(on="create")
  58.      * @ORM\Column(type="datetime", nullable=true)
  59.      */
  60.     protected $create_at;
  61.     /**
  62.      * @var string $update_at
  63.      *
  64.      * @Gedmo\Timestampable(on="update")
  65.      * @ORM\Column(type="datetime", nullable=true)
  66.      */
  67.     protected $update_at;
  68.     public function __toString(): string
  69.     {
  70.         return $this->name;
  71.     }
  72.     public function getId(): ?int
  73.     {
  74.         return $this->id;
  75.     }
  76.     public function getName(): ?string
  77.     {
  78.         return $this->name;
  79.     }
  80.     public function setName(?string $name): static
  81.     {
  82.         $this->name $name;
  83.         return $this;
  84.     }
  85.     public function getSlug(): ?string
  86.     {
  87.         return $this->slug;
  88.     }
  89.     public function setSlug(?string $slug): static
  90.     {
  91.         $this->slug $slug;
  92.         return $this;
  93.     }
  94.     public function getCreateAt(): ?\DateTimeInterface
  95.     {
  96.         return $this->create_at;
  97.     }
  98.     public function setCreateAt(?\DateTimeInterface $create_at): static
  99.     {
  100.         $this->create_at $create_at;
  101.         return $this;
  102.     }
  103.     public function getUpdateAt(): ?\DateTimeInterface
  104.     {
  105.         return $this->update_at;
  106.     }
  107.     public function setUpdateAt(?\DateTimeInterface $update_at): static
  108.     {
  109.         $this->update_at $update_at;
  110.         return $this;
  111.     }
  112.     public function getImage(): ?SonataMediaMedia
  113.     {
  114.         return $this->image;
  115.     }
  116.     public function setImage(?SonataMediaMedia $image): static
  117.     {
  118.         $this->image $image;
  119.         return $this;
  120.     }
  121.     public function getImageMobile(): ?SonataMediaMedia
  122.     {
  123.         return $this->image_mobile;
  124.     }
  125.     public function setImageMobile(?SonataMediaMedia $image_mobile): static
  126.     {
  127.         $this->image_mobile $image_mobile;
  128.         return $this;
  129.     }
  130.     public function getSeo(): ?Seo
  131.     {
  132.         return $this->seo;
  133.     }
  134.     public function setSeo(?Seo $seo): static
  135.     {
  136.         $this->seo $seo;
  137.         return $this;
  138.     }
  139. }