<?php
namespace App\Entity;
use ApiPlatform\Metadata\ApiResource;
use App\Repository\PwAccidentPlanedHistoryMediaRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
use ApiPlatform\Metadata\ApiFilter;
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
use ApiPlatform\Doctrine\Orm\Filter\DateFilter;
#[ORM\Entity(repositoryClass: PwAccidentPlanedHistoryMediaRepository::class)]
#[ApiResource(
normalizationContext: ['groups' => ['PwAccident:read']],
denormalizationContext: ['groups' => ['PwAccident:write']],
)]
#[ApiFilter(DateFilter::class, properties: ['datePlanIn'])]
class PwAccidentPlanedHistoryMedia
{
#[Groups(['PwAccident:read', 'PwAccident:write'])]
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[Groups(['PwAccident:read', 'PwAccident:write'])]
#[ORM\OneToOne(cascade: ['persist', 'remove'])]
#[ORM\JoinColumn(nullable: false)]
private ?MediaObject $media = null;
#[Groups(['PwAccident:read', 'PwAccident:write'])]
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
private ?\DateTimeInterface $dateCreate = null;
public function getId(): ?int
{
return $this->id;
}
public function getMedia(): ?MediaObject
{
return $this->media;
}
public function setMedia(MediaObject $media): static
{
$this->media = $media;
return $this;
}
public function getDateCreate(): ?\DateTimeInterface
{
return $this->dateCreate;
}
public function setDateCreate(\DateTimeInterface $dateCreate): static
{
$this->dateCreate = $dateCreate;
return $this;
}
}