src/Entity/PlaylistVideoConfig.php line 35

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use ApiPlatform\Core\Annotation\ApiSubresource;
  5. use ApiPlatform\Core\Annotation\ApiFilter;
  6. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
  7. use ApiPlatform\Core\Serializer\Filter\GroupFilter;
  8. use App\Repository\PlaylistVideoConfigRepository;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Doctrine\ORM\Mapping\Table as Table;
  11. use Symfony\Component\Serializer\Annotation\Groups;
  12. use Symfony\Component\Validator\Constraints as Assert;
  13. /**
  14.  * @Table(name="playlist_video_config")
  15.  * @ORM\Entity(repositoryClass=PlaylistVideoConfigRepository::class)
  16.  * @ApiResource(
  17.  *      normalizationContext={
  18.  *          "groups"={"playlist_video_config:read"}
  19.  *      },
  20.  *      denormalizationContext={
  21.  *          "groups"={"playlist_video_config:write"}
  22.  *      },
  23.  *      collectionOperations={
  24.  *          "get"={
  25.  *              "security"="is_granted('ROLE_USER')"
  26.  *          }
  27.  *      },
  28.  *      itemOperations={}
  29.  * )
  30.  * @ApiFilter(SearchFilter::class, properties={"playlistId": "exact", "videoId": "exact"})
  31.  */
  32. class PlaylistVideoConfig
  33. {
  34.     /**
  35.      * @ORM\Id
  36.      * @ORM\GeneratedValue
  37.      * @ORM\Column(type="integer")
  38.      */
  39.     private $id;
  40.     /**
  41.      * @ORM\Column(type="integer")
  42.      */
  43.     private $playlistId;
  44.     /**
  45.      * @ORM\Column(type="integer")
  46.      */
  47.     private $videoId;
  48.     /**
  49.      * @ORM\Column(name="`rank`", type="integer", nullable=true)
  50.      */
  51.     private $rank;
  52.     public function getId(): ?int
  53.     {
  54.         return $this->id;
  55.     }
  56.     public function getPlaylistId(): ?int
  57.     {
  58.         return $this->playlistId;
  59.     }
  60.     public function setPlaylistId(int $playlistId): self
  61.     {
  62.         $this->playlistId $playlistId;
  63.         return $this;
  64.     }
  65.     public function getVideoId(): ?int
  66.     {
  67.         return $this->videoId;
  68.     }
  69.     public function setVideoId(int $videoId): self
  70.     {
  71.         $this->videoId $videoId;
  72.         return $this;
  73.     }
  74.     public function getRank(): ?int
  75.     {
  76.         return $this->rank;
  77.     }
  78.     public function setRank(?int $rank): self
  79.     {
  80.         $this->rank $rank;
  81.         return $this;
  82.     }
  83. }