src/Entity/Content/NewsType.php line 12

  1. <?php
  2. namespace App\Entity\Content;
  3. use App\Entity\Traits\ActiveTrait;
  4. use App\Entity\Traits\DeletedTrait;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Table(name'news_type')]
  8. #[ORM\Entity(repositoryClass'App\Repository\Content\NewsTypeRepository')]
  9. class NewsType
  10. {
  11.     use DeletedTrait;
  12.     use ActiveTrait;
  13.     public const TYPE_NEWS='news';
  14.     public const TYPE_EVENT='event';
  15.     /**
  16.      * @var int|null
  17.      */
  18.     #[ORM\Id]
  19.     #[ORM\GeneratedValue(strategy'AUTO')]
  20.     #[ORM\Column(type'integer')]
  21.     private $id;
  22.     /**
  23.      * @var string|null
  24.      */
  25.     #[ORM\Column(type'string')]
  26.     private $caption;
  27.     /**
  28.      * @var string|null
  29.      */
  30.     #[ORM\Column(type'string')]
  31.     private $slug;
  32.     /**
  33.      * @var Collection|News[]
  34.      */
  35.     #[ORM\OneToMany(targetEntity'App\Entity\Content\News'mappedBy'type')]
  36.     private $news;
  37.     /**
  38.      * @var string
  39.      */
  40.     #[ORM\Column(type'string'length10nullablefalse)]
  41.     private $type;
  42.     /**
  43.      * @return int|null
  44.      */
  45.     public function getId(): ?int
  46.     {
  47.         return $this->id;
  48.     }
  49.     /**
  50.      * @param int|null $id
  51.      */
  52.     public function setId(?int $id): void
  53.     {
  54.         $this->id $id;
  55.     }
  56.     /**
  57.      * @return string|null
  58.      */
  59.     public function getCaption(): ?string
  60.     {
  61.         return $this->caption;
  62.     }
  63.     /**
  64.      * @param string|null $caption
  65.      */
  66.     public function setCaption(?string $caption): void
  67.     {
  68.         $this->caption $caption;
  69.     }
  70.     /**
  71.      * @return News[]|Collection
  72.      */
  73.     public function getNews()
  74.     {
  75.         return $this->news;
  76.     }
  77.     /**
  78.      * @param News[]|Collection $news
  79.      */
  80.     public function setNews($news): void
  81.     {
  82.         $this->news $news;
  83.     }
  84.     /**
  85.      * @return string|null
  86.      */
  87.     public function getSlug(): ?string
  88.     {
  89.         return $this->slug;
  90.     }
  91.     /**
  92.      * @param string|null $slug
  93.      */
  94.     public function setSlug(?string $slug): void
  95.     {
  96.         $this->slug $slug;
  97.     }
  98.     /**
  99.      * @return string
  100.      */
  101.     public function getType(): ?string
  102.     {
  103.         return $this->type;
  104.     }
  105.     /**
  106.      * @param string $type
  107.      */
  108.     public function setType(string $type): void
  109.     {
  110.         $this->type $type;
  111.     }
  112. }