<?php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiFilter;
use ApiPlatform\Core\Annotation\ApiResource;
use ApiPlatform\Core\Annotation\ApiSubresource;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\BooleanFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\OrderFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
use ApiPlatform\Core\Serializer\Filter\GroupFilter;
use ApiPlatform\Core\Serializer\Filter\PropertyFilter;
use App\Repository\CalcProgramVideoRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass=CalcProgramVideoRepository::class)
* @ApiResource(
* normalizationContext={
* "groups"={"calc_program_video:read"}
* },
* denormalizationContext={
* "groups"={"calc_program_video:write"}
* },
* collectionOperations={
* "get"={
* "security"="is_granted('ROLE_USER')"
* }
* },
* itemOperations={
* "get"={
* "security"="is_granted('ROLE_USER')"
* }
* }
* )
* @ApiFilter(OrderFilter::class)
* @ApiFilter(SearchFilter::class)
* @ApiFilter(BooleanFilter::class)
* @ApiFilter(PropertyFilter::class,
* arguments={
* "parameterName"="fields",
* "overrideDefaultProperties"=true
* }
* )
*/
class CalcProgramVideo
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Groups({"calc_program_video:read"})
*/
private $id;
/**
* @ORM\Column(type="integer", nullable=true)
* @Groups({"calc_program_video:read"})
*/
private $programId;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"calc_program_video:read"})
*/
private $programName;
/**
* @ORM\Column(type="integer", nullable=true)
* @Groups({"calc_program_video:read", "program:read"})
*/
private $videoId;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"calc_program_video:read", "program:read"})
*/
private $videoName;
/**
* @ORM\Column(type="integer", nullable=true)
* @Groups({"calc_program_video:read", "program:read"})
*/
private $categoryId;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"calc_program_video:read", "program:read"})
*/
private $categoryName;
/**
* @ORM\Column(type="integer", nullable=true)
* @Groups({"calc_program_video:read", "program:read"})
*/
private $channelId;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"calc_program_video:read", "program:read"})
*/
private $channelName;
/**
* @ORM\Column(type="integer", nullable=true)
* @Groups({"calc_program_video:read", "program:read"})
*/
private $playlistId;
/**
* @ORM\Column(type="datetime")
* @Groups({"calc_program_video:read"})
*/
private $createdAt;
public function __construct() {
$this->createdAt = new \DateTime();
}
public function getId(): ?int
{
return $this->id;
}
public function getProgramId(): ?int
{
return $this->programId;
}
public function setProgramId(int $programId): self
{
$this->programId = $programId;
return $this;
}
public function getProgramName(): ?string
{
return $this->programName;
}
public function setProgramName(string $programName): self
{
$this->programName = $programName;
return $this;
}
public function getVideoId(): ?int
{
return $this->videoId;
}
public function setVideoId(int $videoId): self
{
$this->videoId = $videoId;
return $this;
}
public function getVideoName(): ?string
{
return $this->videoName;
}
public function setVideoName(string $videoName): self
{
$this->videoName = $videoName;
return $this;
}
public function getCategoryId(): ?int
{
return $this->categoryId;
}
public function setCategoryId(int $categoryId): self
{
$this->categoryId = $categoryId;
return $this;
}
public function getCategoryName(): ?string
{
return $this->categoryName;
}
public function setCategoryName(?string $categoryName): self
{
$this->categoryName = $categoryName;
return $this;
}
public function getChannelId(): ?int
{
return $this->channelId;
}
public function setChannelId(int $channelId): self
{
$this->channelId = $channelId;
return $this;
}
public function getChannelName(): ?string
{
return $this->channelName;
}
public function setChannelName(?string $channelName): self
{
$this->channelName = $channelName;
return $this;
}
public function getPlaylistId(): ?int
{
return $this->playlistId;
}
public function setPlaylistId(?int $playlistId): self
{
$this->playlistId = $playlistId;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
}