src/Entity/PwAccidentPlanedHistoryMedia.php line 22

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\PwAccidentPlanedHistoryMediaRepository;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. use ApiPlatform\Metadata\ApiFilter;
  9. use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
  10. use ApiPlatform\Doctrine\Orm\Filter\DateFilter;
  11. #[ORM\Entity(repositoryClassPwAccidentPlanedHistoryMediaRepository::class)]
  12. #[ApiResource(
  13.     normalizationContext: ['groups' => ['PwAccident:read']],
  14.     denormalizationContext: ['groups' => ['PwAccident:write']],
  15. )]
  16. #[ApiFilter(DateFilter::class, properties: ['datePlanIn'])]
  17. class PwAccidentPlanedHistoryMedia
  18. {
  19.     #[Groups(['PwAccident:read''PwAccident:write'])]
  20.     #[ORM\Id]
  21.     #[ORM\GeneratedValue]
  22.     #[ORM\Column]
  23.     private ?int $id null;
  24.     #[Groups(['PwAccident:read''PwAccident:write'])]
  25.     #[ORM\OneToOne(cascade: ['persist''remove'])]
  26.     #[ORM\JoinColumn(nullablefalse)]
  27.     private ?MediaObject $media null;
  28.     #[Groups(['PwAccident:read''PwAccident:write'])]
  29.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  30.     private ?\DateTimeInterface $dateCreate null;
  31.     public function getId(): ?int
  32.     {
  33.         return $this->id;
  34.     }
  35.     public function getMedia(): ?MediaObject
  36.     {
  37.         return $this->media;
  38.     }
  39.     public function setMedia(MediaObject $media): static
  40.     {
  41.         $this->media $media;
  42.         return $this;
  43.     }
  44.     public function getDateCreate(): ?\DateTimeInterface
  45.     {
  46.         return $this->dateCreate;
  47.     }
  48.     public function setDateCreate(\DateTimeInterface $dateCreate): static
  49.     {
  50.         $this->dateCreate $dateCreate;
  51.         return $this;
  52.     }
  53. }