src/Entity/News.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="news")
  11.  */
  12. class News
  13. {
  14.     /**
  15.     * @ORM\Id
  16.     * @ORM\Column(type="integer")
  17.     * @ORM\GeneratedValue(strategy="AUTO")
  18.     */
  19.     protected $id;
  20.     /**
  21.     * @var boolean $public
  22.     *
  23.     * @ORM\Column(type="boolean", nullable=true)
  24.     */
  25.     protected $public;
  26.     /**
  27.     * @var string $name
  28.     *
  29.     * @ORM\Column(type="string", nullable=true)
  30.     */
  31.     protected $name;
  32.     /**
  33.      * @var string $slug
  34.      * @Gedmo\Slug(fields={"name"}, updatable=true, unique=true)
  35.      *
  36.      * @ORM\Column(type="string", nullable=true)
  37.      */
  38.     protected $slug;
  39.     /**
  40.     * @var string $description
  41.     *
  42.     * @ORM\Column(type="text", nullable=true)
  43.     */
  44.     protected $description;
  45.     /**
  46.     * @var text $body
  47.     *
  48.     * @ORM\Column(type="text", nullable=true)
  49.     */
  50.     protected $body;
  51.     /**
  52.     * @var string $image
  53.     *
  54.     * @ORM\ManyToOne(targetEntity="App\Entity\SonataMediaMedia", cascade = {"persist"})
  55.     * @ORM\JoinColumn(name="image_id", referencedColumnName="id", onDelete="SET NULL")
  56.     */
  57.     protected $image;
  58.     /**
  59.     * @var string $image_cover
  60.     *
  61.     * @ORM\ManyToOne(targetEntity="App\Entity\SonataMediaMedia", cascade = {"persist"})
  62.     * @ORM\JoinColumn(name="image_cover_id", referencedColumnName="id", onDelete="SET NULL")
  63.     */
  64.     protected $image_cover;
  65.     /**
  66.     * @var date $public_date
  67.     *
  68.     * @ORM\Column(type="date", nullable=true)
  69.     */
  70.     protected $public_date;
  71.     /**
  72.     * @var \App\Entity\Seo $seo
  73.     *
  74.     * @ORM\ManyToOne(targetEntity="App\Entity\Seo", inversedBy="news")
  75.     * @ORM\JoinColumn(name="seo_id", referencedColumnName="id")
  76.     */
  77.     private $seo;
  78.     /**
  79.      * @var string $create_at
  80.      *
  81.      * @Gedmo\Timestampable(on="create")
  82.      * @ORM\Column(type="datetime", nullable=true)
  83.      */
  84.     protected $create_at;
  85.     /**
  86.      * @var string $update_at
  87.      *
  88.      * @Gedmo\Timestampable(on="update")
  89.      * @ORM\Column(type="datetime", nullable=true)
  90.      */
  91.     protected $update_at;
  92.     public function getId(): ?int
  93.     {
  94.         return $this->id;
  95.     }
  96.     public function isPublic(): ?bool
  97.     {
  98.         return $this->public;
  99.     }
  100.     public function setPublic(?bool $public): static
  101.     {
  102.         $this->public $public;
  103.         return $this;
  104.     }
  105.     public function getName(): ?string
  106.     {
  107.         return $this->name;
  108.     }
  109.     public function setName(?string $name): static
  110.     {
  111.         $this->name $name;
  112.         return $this;
  113.     }
  114.     public function getSlug(): ?string
  115.     {
  116.         return $this->slug;
  117.     }
  118.     public function setSlug(?string $slug): static
  119.     {
  120.         $this->slug $slug;
  121.         return $this;
  122.     }
  123.     public function getDescription(): ?string
  124.     {
  125.         return $this->description;
  126.     }
  127.     public function setDescription(?string $description): static
  128.     {
  129.         $this->description $description;
  130.         return $this;
  131.     }
  132.     public function getCreateAt(): ?\DateTimeInterface
  133.     {
  134.         return $this->create_at;
  135.     }
  136.     public function setCreateAt(?\DateTimeInterface $create_at): static
  137.     {
  138.         $this->create_at $create_at;
  139.         return $this;
  140.     }
  141.     public function getUpdateAt(): ?\DateTimeInterface
  142.     {
  143.         return $this->update_at;
  144.     }
  145.     public function setUpdateAt(?\DateTimeInterface $update_at): static
  146.     {
  147.         $this->update_at $update_at;
  148.         return $this;
  149.     }
  150.     public function getImage(): ?SonataMediaMedia
  151.     {
  152.         return $this->image;
  153.     }
  154.     public function setImage(?SonataMediaMedia $image): static
  155.     {
  156.         $this->image $image;
  157.         return $this;
  158.     }
  159.     public function getImageCover(): ?SonataMediaMedia
  160.     {
  161.         return $this->image_cover;
  162.     }
  163.     public function setImageCover(?SonataMediaMedia $image_cover): static
  164.     {
  165.         $this->image_cover $image_cover;
  166.         return $this;
  167.     }
  168.     public function getPublicDate(): ?\DateTimeInterface
  169.     {
  170.         return $this->public_date;
  171.     }
  172.     public function setPublicDate(?\DateTimeInterface $public_date): static
  173.     {
  174.         $this->public_date $public_date;
  175.         return $this;
  176.     }
  177.     public function getSeo(): ?Seo
  178.     {
  179.         return $this->seo;
  180.     }
  181.     public function setSeo(?Seo $seo): static
  182.     {
  183.         $this->seo $seo;
  184.         return $this;
  185.     }
  186.     public function getBody(): ?string
  187.     {
  188.         return $this->body;
  189.     }
  190.     public function setBody(?string $body): static
  191.     {
  192.         $this->body $body;
  193.         return $this;
  194.     }
  195. }