src/Entity/PwAccident.php line 25

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\PwAccidentRepository;
  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. #[ORM\Entity(repositoryClassPwAccidentRepository::class)]
  11. #[ApiResource(
  12.     normalizationContext: ['groups' => ['PwAccident:read']],
  13.     denormalizationContext: ['groups' => ['PwAccident:write']],
  14.     cacheHeaders: [
  15.         'max_age' => 60
  16.         'shared_max_age' => 120
  17.         'vary' => ['Authorization''Accept-Language']
  18.     ],
  19. )]
  20. #[ApiFilter(SearchFilter::class, properties: ['city.id' => 'exact''street.id' => 'exact''otg.id' => 'exact' ])]
  21. class PwAccident
  22. {
  23.     #[ORM\Id]
  24.     #[ORM\GeneratedValue(strategy'SEQUENCE')]
  25.     #[ORM\Column(typeTypes::INTEGER)]
  26.     #[Groups(['PwAccident:read''PwAccident:write'])]
  27.     private ?int $id null;
  28.     #[Groups(['PwAccident:read''PwAccident:write'])]
  29.     #[ORM\Column(length255nullabletrue)]
  30.     private ?string $code_otg null;
  31.     #[Groups(['PwAccident:read''PwAccident:write'])]
  32.     #[ORM\ManyToOne(inversedBy'pwAccidents')]
  33.     private ?PwCity $city null;
  34.     #[Groups(['PwAccident:read''PwAccident:write'])]
  35.     #[ORM\ManyToOne(inversedBy'pwAccidents')]
  36.     private ?PwStreet $street null;
  37.     #[Groups(['PwAccident:read''PwAccident:write'])]
  38.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  39.     private ?\DateTimeInterface $dateEvent null;
  40.     #[Groups(['PwAccident:read''PwAccident:write'])]
  41.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  42.     private ?\DateTimeInterface $datePlanIn null;
  43.     #[Groups(['PwAccident:read''PwAccident:write'])]
  44.     #[ORM\Column(length255nullabletrue)]
  45.     private ?string $koment null;
  46.     #[Groups(['PwAccident:read''PwAccident:write'])]
  47.     #[ORM\Column(typeTypes::SMALLINTnullabletrue)]
  48.     private ?int $switchSubReason null;
  49.     #[Groups(['PwAccident:read''PwAccident:write'])]
  50.     #[ORM\ManyToOne(inversedBy'pwAccidents')]
  51.     #[ORM\JoinColumn(nullablefalse)]
  52.     private ?PwOtg $otg null;
  53.     #[Groups(['PwAccident:read''PwAccident:write'])]
  54.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  55.     private ?string $buildingNames null;
  56.     #[Groups(['PwAccident:read''PwAccident:write'])]
  57.     #[ORM\Column]
  58.     private ?int $typeOff null;
  59.     public function getId(): ?int
  60.     {
  61.         return $this->id;
  62.     }
  63.     public function getCodeOtg(): ?string
  64.     {
  65.         return $this->code_otg;
  66.     }
  67.     public function setCodeOtg(?string $code_otg): static
  68.     {
  69.         $this->code_otg $code_otg;
  70.         return $this;
  71.     }
  72.     public function getCity(): ?PwCity
  73.     {
  74.         return $this->city;
  75.     }
  76.     public function setCity(?PwCity $city): static
  77.     {
  78.         $this->city $city;
  79.         return $this;
  80.     }
  81.     public function getStreet(): ?PwStreet
  82.     {
  83.         return $this->street;
  84.     }
  85.     public function setStreet(?PwStreet $street): static
  86.     {
  87.         $this->street $street;
  88.         return $this;
  89.     }
  90.     public function getDateEvent(): ?\DateTimeInterface
  91.     {
  92.         return $this->dateEvent;
  93.     }
  94.     public function setDateEvent(?\DateTimeInterface $dateEvent): static
  95.     {
  96.         $this->dateEvent $dateEvent;
  97.         return $this;
  98.     }
  99.     public function getDatePlanIn(): ?\DateTimeInterface
  100.     {
  101.         return $this->datePlanIn;
  102.     }
  103.     public function setDatePlanIn(?\DateTimeInterface $datePlanIn): static
  104.     {
  105.         $this->datePlanIn $datePlanIn;
  106.         return $this;
  107.     }
  108.     public function getKoment(): ?string
  109.     {
  110.         return $this->koment;
  111.     }
  112.     public function setKoment(?string $koment): static
  113.     {
  114.         $this->koment $koment;
  115.         return $this;
  116.     }
  117.     public function getSwitchSubReason(): ?int
  118.     {
  119.         return $this->switchSubReason;
  120.     }
  121.     public function setSwitchSubReason(?int $switchSubReason): static
  122.     {
  123.         $this->switchSubReason $switchSubReason;
  124.         return $this;
  125.     }
  126.     public function getOtg(): ?PwOtg
  127.     {
  128.         return $this->otg;
  129.     }
  130.     public function setOtg(?PwOtg $otg): static
  131.     {
  132.         $this->otg $otg;
  133.         return $this;
  134.     }
  135.     public function getBuildingNames(): ?string
  136.     {
  137.         return $this->buildingNames;
  138.     }
  139.     public function setBuildingNames(?string $buildingNames): static
  140.     {
  141.         $this->buildingNames $buildingNames;
  142.         return $this;
  143.     }
  144.     public function getTypeOff(): ?int
  145.     {
  146.         return $this->typeOff;
  147.     }
  148.     public function setTypeOff(int $typeOff): static
  149.     {
  150.         $this->typeOff $typeOff;
  151.         return $this;
  152.     }
  153. }