src/Entity/News.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\NewsRepository;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use ApiPlatform\Metadata\Get;
  8. use ApiPlatform\Metadata\Post;
  9. use ApiPlatform\Metadata\Put;
  10. use ApiPlatform\Metadata\Delete;
  11. #[ORM\Entity(repositoryClassNewsRepository::class)]
  12. #[Get]
  13. #[Put(security"is_granted('ROLE_ADMIN')")]
  14. #[Post(security"is_granted('ROLE_ADMIN')")]
  15. #[Delete(security"is_granted('ROLE_ADMIN')")]
  16. #[ApiResource(order: ['id' => 'DESC'], paginationClientItemsPerPagetrue)]
  17. class News
  18. {
  19.     const Test 5656565;
  20.     
  21.     #[ORM\Id]
  22.     #[ORM\GeneratedValue]
  23.     #[ORM\Column]
  24.     private ?int $id null;
  25.     #[ORM\Column(length255)]
  26.     private ?string $name null;
  27.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  28.     private ?\DateTimeInterface $date null;
  29.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  30.     private ?string $news_shot null;
  31.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  32.     private ?string $news_full null;
  33.     #[ORM\Column(length2)]
  34.     private ?string $active null;
  35.     #[ORM\Column(length20nullabletrue)]
  36.     private ?string $top null;
  37.     #[ORM\Column(length255nullabletrue)]
  38.     private ?string $audio_link null;
  39.     #[ORM\Column(length255nullabletrue)]
  40.     private ?string $video_link null;
  41.     #[ORM\Column(length255nullabletrue)]
  42.     private ?string $audio_title null;
  43.     #[ORM\Column(length20nullabletrue)]
  44.     private ?string $audio_active null;
  45.     #[ORM\Column(length255nullabletrue)]
  46.     private ?string $video_img null;
  47.     #[ORM\Column(length255nullabletrue)]
  48.     private ?string $imgLink null;
  49.     public function getId(): ?int
  50.     {
  51.         return $this->id;
  52.     }
  53.     public function getName(): ?string
  54.     {
  55.         return $this->name;
  56.     }
  57.     public function setName(string $name): self
  58.     {
  59.         $this->name $name;
  60.         return $this;
  61.     }
  62.     public function getDate(): ?\DateTimeInterface
  63.     {
  64.         return $this->date;
  65.     }
  66.     public function setDate(\DateTimeInterface $date): self
  67.     {
  68.         $this->date $date;
  69.         return $this;
  70.     }
  71.     public function getNewsShot(): ?string
  72.     {
  73.         return $this->news_shot;
  74.     }
  75.     public function setNewsShot(?string $news_shot): self
  76.     {
  77.         $this->news_shot $news_shot;
  78.         return $this;
  79.     }
  80.     public function getNewsFull(): ?string
  81.     {
  82.         return $this->news_full;
  83.     }
  84.     public function setNewsFull(?string $news_full): self
  85.     {
  86.         $this->news_full $news_full;
  87.         return $this;
  88.     }
  89.     public function getActive(): ?string
  90.     {
  91.         return $this->active;
  92.     }
  93.     public function setActive(string $active): self
  94.     {
  95.         $this->active $active;
  96.         return $this;
  97.     }
  98.     public function getTop(): ?string
  99.     {
  100.         return $this->top;
  101.     }
  102.     public function setTop(?string $top): self
  103.     {
  104.         $this->top $top;
  105.         return $this;
  106.     }
  107.     public function getAudioLink(): ?string
  108.     {
  109.         return $this->audio_link;
  110.     }
  111.     public function setAudioLink(?string $audio_link): self
  112.     {
  113.         $this->audio_link $audio_link;
  114.         return $this;
  115.     }
  116.     public function getVideoLink(): ?string
  117.     {
  118.         return $this->video_link;
  119.     }
  120.     public function setVideoLink(?string $video_link): self
  121.     {
  122.         $this->video_link $video_link;
  123.         return $this;
  124.     }
  125.     public function getAudioTitle(): ?string
  126.     {
  127.         return $this->audio_title;
  128.     }
  129.     public function setAudioTitle(?string $audio_title): self
  130.     {
  131.         $this->audio_title $audio_title;
  132.         return $this;
  133.     }
  134.     public function getAudioActive(): ?string
  135.     {
  136.         return $this->audio_active;
  137.     }
  138.     public function setAudioActive(?string $audio_active): self
  139.     {
  140.         $this->audio_active $audio_active;
  141.         return $this;
  142.     }
  143.     public function getVideoImg(): ?string
  144.     {
  145.         return $this->video_img;
  146.     }
  147.     public function setVideoImg(?string $video_img): self
  148.     {
  149.         $this->video_img $video_img;
  150.         return $this;
  151.     }
  152.     public function getImgLink(): ?string
  153.     {
  154.         return $this->imgLink;
  155.     }
  156.     public function setImgLink(?string $imgLink): self
  157.     {
  158.         $this->imgLink $imgLink;
  159.         return $this;
  160.     }
  161. }