<?php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use ApiPlatform\Core\Annotation\ApiSubresource;
use ApiPlatform\Core\Annotation\ApiFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
use ApiPlatform\Core\Serializer\Filter\GroupFilter;
use App\Repository\PlaylistVideoConfigRepository;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\Table as Table;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @Table(name="playlist_video_config")
* @ORM\Entity(repositoryClass=PlaylistVideoConfigRepository::class)
* @ApiResource(
* normalizationContext={
* "groups"={"playlist_video_config:read"}
* },
* denormalizationContext={
* "groups"={"playlist_video_config:write"}
* },
* collectionOperations={
* "get"={
* "security"="is_granted('ROLE_USER')"
* }
* },
* itemOperations={}
* )
* @ApiFilter(SearchFilter::class, properties={"playlistId": "exact", "videoId": "exact"})
*/
class PlaylistVideoConfig
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="integer")
*/
private $playlistId;
/**
* @ORM\Column(type="integer")
*/
private $videoId;
/**
* @ORM\Column(name="`rank`", type="integer", nullable=true)
*/
private $rank;
public function getId(): ?int
{
return $this->id;
}
public function getPlaylistId(): ?int
{
return $this->playlistId;
}
public function setPlaylistId(int $playlistId): self
{
$this->playlistId = $playlistId;
return $this;
}
public function getVideoId(): ?int
{
return $this->videoId;
}
public function setVideoId(int $videoId): self
{
$this->videoId = $videoId;
return $this;
}
public function getRank(): ?int
{
return $this->rank;
}
public function setRank(?int $rank): self
{
$this->rank = $rank;
return $this;
}
}