src/Entity/PwAccidentHistory.php line 25

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\PwAccidentHistoryRepository;
  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. use App\Filter\DateRangeFilter;
  12. #[ORM\Entity(repositoryClassPwAccidentHistoryRepository::class)]
  13. #[ApiResource(
  14.     normalizationContext: ['groups' => ['PwAccident:read']],
  15.     denormalizationContext: ['groups' => ['PwAccident:write']],
  16.     order: ['dateEvent' => 'ASC'],
  17. )]
  18. #[ApiFilter(SearchFilter::class, properties: ['city.id' => 'exact''street.id' => 'exact''otg.id' => 'exact' 'typeOff' => 'exact''switchSubReason' => 'exact'])]
  19. #[ApiFilter(DateFilter::class, properties: ['datePlanIn'])]
  20. #[ApiFilter(DateRangeFilter::class)]
  21. class PwAccidentHistory
  22. {
  23.     #[ORM\Id]
  24.     #[ORM\GeneratedValue(strategy'IDENTITY')]
  25.     #[ORM\Column]
  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.     #[Groups(['PwAccident:read''PwAccident:write'])]
  60.     #[ORM\Column(length255nullabletrue)]
  61.     private ?string $dno null;
  62.     #[Groups(['PwAccident:read''PwAccident:write'])]
  63.     #[ORM\Column(length50,  uniquetrue)]
  64.     private ?string $hash null;
  65.     public function getId(): ?int
  66.     {
  67.         return $this->id;
  68.     }
  69.     public function getCodeOtg(): ?string
  70.     {
  71.         return $this->code_otg;
  72.     }
  73.     public function setCodeOtg(?string $code_otg): static
  74.     {
  75.         $this->code_otg $code_otg;
  76.         return $this;
  77.     }
  78.     public function getCity(): ?PwCity
  79.     {
  80.         return $this->city;
  81.     }
  82.     public function setCity(?PwCity $city): static
  83.     {
  84.         $this->city $city;
  85.         return $this;
  86.     }
  87.     public function getStreet(): ?PwStreet
  88.     {
  89.         return $this->street;
  90.     }
  91.     public function setStreet(?PwStreet $street): static
  92.     {
  93.         $this->street $street;
  94.         return $this;
  95.     }
  96.     public function getDateEvent(): ?\DateTimeInterface
  97.     {
  98.         return $this->dateEvent;
  99.     }
  100.     public function setDateEvent(?\DateTimeInterface $dateEvent): static
  101.     {
  102.         $this->dateEvent $dateEvent;
  103.         return $this;
  104.     }
  105.     public function getDatePlanIn(): ?\DateTimeInterface
  106.     {
  107.         return $this->datePlanIn;
  108.     }
  109.     public function setDatePlanIn(?\DateTimeInterface $datePlanIn): static
  110.     {
  111.         $this->datePlanIn $datePlanIn;
  112.         return $this;
  113.     }
  114.     public function getKoment(): ?string
  115.     {
  116.         return $this->koment;
  117.     }
  118.     public function setKoment(?string $koment): static
  119.     {
  120.         $this->koment $koment;
  121.         return $this;
  122.     }
  123.     public function getSwitchSubReason(): ?int
  124.     {
  125.         return $this->switchSubReason;
  126.     }
  127.     public function setSwitchSubReason(?int $switchSubReason): static
  128.     {
  129.         $this->switchSubReason $switchSubReason;
  130.         return $this;
  131.     }
  132.     public function getOtg(): ?PwOtg
  133.     {
  134.         return $this->otg;
  135.     }
  136.     public function setOtg(?PwOtg $otg): static
  137.     {
  138.         $this->otg $otg;
  139.         return $this;
  140.     }
  141.     public function getBuildingNames(): ?string
  142.     {
  143.         return $this->buildingNames;
  144.     }
  145.     public function setBuildingNames(?string $buildingNames): static
  146.     {
  147.         $this->buildingNames $buildingNames;
  148.         return $this;
  149.     }
  150.     public function getTypeOff(): ?int
  151.     {
  152.         return $this->typeOff;
  153.     }
  154.     public function setTypeOff(int $typeOff): static
  155.     {
  156.         $this->typeOff $typeOff;
  157.         return $this;
  158.     }
  159.     public function getDno(): ?string
  160.     {
  161.         return $this->dno;
  162.     }
  163.     public function setDno(?string $dno): static
  164.     {
  165.         $this->dno $dno;
  166.         return $this;
  167.     }
  168.     public function getHash(): ?string
  169.     {
  170.         return $this->hash;
  171.     }
  172.     public function setHash(string $hash): static
  173.     {
  174.         $this->hash $hash;
  175.         return $this;
  176.     }
  177. }