src/Entity/CalcProgramVideo.php line 51

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Core\Annotation\ApiFilter;
  4. use ApiPlatform\Core\Annotation\ApiResource;
  5. use ApiPlatform\Core\Annotation\ApiSubresource;
  6. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\BooleanFilter;
  7. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\OrderFilter;
  8. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
  9. use ApiPlatform\Core\Serializer\Filter\GroupFilter;
  10. use ApiPlatform\Core\Serializer\Filter\PropertyFilter;
  11. use App\Repository\CalcProgramVideoRepository;
  12. use Doctrine\Common\Collections\ArrayCollection;
  13. use Doctrine\Common\Collections\Collection;
  14. use Doctrine\ORM\Mapping as ORM;
  15. use Gedmo\Mapping\Annotation as Gedmo;
  16. use Symfony\Component\Serializer\Annotation\Groups;
  17. use Symfony\Component\Validator\Constraints as Assert;
  18. /**
  19.  * @ORM\Entity(repositoryClass=CalcProgramVideoRepository::class)
  20.  * @ApiResource(
  21.  *      normalizationContext={
  22.  *          "groups"={"calc_program_video:read"}
  23.  *      },
  24.  *      denormalizationContext={
  25.  *          "groups"={"calc_program_video:write"}
  26.  *      },
  27.  *      collectionOperations={
  28.  *          "get"={
  29.  *              "security"="is_granted('ROLE_USER')"
  30.  *          } 
  31.  *      },
  32.  *      itemOperations={
  33.  *          "get"={
  34.  *              "security"="is_granted('ROLE_USER')"
  35.  *          }
  36.  *      }
  37.  * )
  38.  * @ApiFilter(OrderFilter::class)
  39.  * @ApiFilter(SearchFilter::class)
  40.  * @ApiFilter(BooleanFilter::class)
  41.  * @ApiFilter(PropertyFilter::class, 
  42.  *      arguments={
  43.  *          "parameterName"="fields", 
  44.  *          "overrideDefaultProperties"=true
  45.  *     }
  46.  * )
  47.  */
  48. class CalcProgramVideo
  49. {
  50.     /**
  51.      * @ORM\Id
  52.      * @ORM\GeneratedValue
  53.      * @ORM\Column(type="integer")
  54.      * @Groups({"calc_program_video:read"})
  55.      */
  56.     private $id;
  57.     /**
  58.      * @ORM\Column(type="integer", nullable=true)
  59.      * @Groups({"calc_program_video:read"})
  60.      */
  61.     private $programId;
  62.     /**
  63.      * @ORM\Column(type="string", length=255, nullable=true)
  64.      * @Groups({"calc_program_video:read"})
  65.      */
  66.     private $programName;
  67.     /**
  68.      * @ORM\Column(type="integer", nullable=true)
  69.      * @Groups({"calc_program_video:read", "program:read"})
  70.      */
  71.     private $videoId;
  72.     /**
  73.      * @ORM\Column(type="string", length=255, nullable=true)
  74.      * @Groups({"calc_program_video:read", "program:read"})
  75.      */
  76.     private $videoName;
  77.     /**
  78.      * @ORM\Column(type="integer", nullable=true)
  79.      * @Groups({"calc_program_video:read", "program:read"})
  80.      */
  81.     private $categoryId;
  82.     /**
  83.      * @ORM\Column(type="string", length=255, nullable=true)
  84.      * @Groups({"calc_program_video:read", "program:read"})
  85.      */
  86.     private $categoryName;
  87.     /**
  88.      * @ORM\Column(type="integer", nullable=true)
  89.      * @Groups({"calc_program_video:read", "program:read"})
  90.      */
  91.     private $channelId;
  92.     /**
  93.      * @ORM\Column(type="string", length=255, nullable=true)
  94.      * @Groups({"calc_program_video:read", "program:read"})
  95.      */
  96.     private $channelName;
  97.     /**
  98.      * @ORM\Column(type="integer", nullable=true)
  99.      * @Groups({"calc_program_video:read", "program:read"})
  100.      */
  101.     private $playlistId;
  102.     /**
  103.      * @ORM\Column(type="datetime")
  104.      * @Groups({"calc_program_video:read"})
  105.      */
  106.     private $createdAt;
  107.     public function __construct() {
  108.         $this->createdAt = new \DateTime();
  109.     }
  110.     public function getId(): ?int
  111.     {
  112.         return $this->id;
  113.     }
  114.     public function getProgramId(): ?int
  115.     {
  116.         return $this->programId;
  117.     }
  118.     public function setProgramId(int $programId): self
  119.     {
  120.         $this->programId $programId;
  121.         return $this;
  122.     }
  123.     public function getProgramName(): ?string
  124.     {
  125.         return $this->programName;
  126.     }
  127.     public function setProgramName(string $programName): self
  128.     {
  129.         $this->programName $programName;
  130.         return $this;
  131.     }
  132.     public function getVideoId(): ?int
  133.     {
  134.         return $this->videoId;
  135.     }
  136.     public function setVideoId(int $videoId): self
  137.     {
  138.         $this->videoId $videoId;
  139.         return $this;
  140.     }
  141.     public function getVideoName(): ?string
  142.     {
  143.         return $this->videoName;
  144.     }
  145.     public function setVideoName(string $videoName): self
  146.     {
  147.         $this->videoName $videoName;
  148.         return $this;
  149.     }
  150.     public function getCategoryId(): ?int
  151.     {
  152.         return $this->categoryId;
  153.     }
  154.     public function setCategoryId(int $categoryId): self
  155.     {
  156.         $this->categoryId $categoryId;
  157.         return $this;
  158.     }
  159.     public function getCategoryName(): ?string
  160.     {
  161.         return $this->categoryName;
  162.     }
  163.     public function setCategoryName(?string $categoryName): self
  164.     {
  165.         $this->categoryName $categoryName;
  166.         return $this;
  167.     }
  168.     public function getChannelId(): ?int
  169.     {
  170.         return $this->channelId;
  171.     }
  172.     public function setChannelId(int $channelId): self
  173.     {
  174.         $this->channelId $channelId;
  175.         return $this;
  176.     }
  177.     public function getChannelName(): ?string
  178.     {
  179.         return $this->channelName;
  180.     }
  181.     public function setChannelName(?string $channelName): self
  182.     {
  183.         $this->channelName $channelName;
  184.         return $this;
  185.     }
  186.     public function getPlaylistId(): ?int
  187.     {
  188.         return $this->playlistId;
  189.     }
  190.     public function setPlaylistId(?int $playlistId): self
  191.     {
  192.         $this->playlistId $playlistId;
  193.         return $this;
  194.     }
  195.     public function getCreatedAt(): ?\DateTimeInterface
  196.     {
  197.         return $this->createdAt;
  198.     }
  199.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  200.     {
  201.         $this->createdAt $createdAt;
  202.         return $this;
  203.     }
  204. }