src/Entity/PwAccidentPlanedHistory.php line 27

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\PwAccidentPlanedHistoryRepository;
  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(repositoryClassPwAccidentPlanedHistoryRepository::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 PwAccidentPlanedHistory
  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'pwAccidentPlanedHistories')]
  33.     private ?PwCity $city null;
  34.     #[Groups(['PwAccident:read''PwAccident:write'])]
  35.     #[ORM\ManyToOne(inversedBy'pwAccidentPlanedHistories')]
  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'pwAccidentPlanedHistories')]
  51.     private ?PwOtg $otg null;
  52.     #[Groups(['PwAccident:read''PwAccident:write'])]
  53.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  54.     private ?string $buildingNames null;
  55.     #[Groups(['PwAccident:read''PwAccident:write'])]
  56.     #[ORM\Column]
  57.     private ?int $typeOff null;
  58.     #[Groups(['PwAccident:read''PwAccident:write'])]
  59.     #[ORM\Column(length255nullabletrue)]
  60.     private ?string $dno null;
  61.     #[Groups(['PwAccident:read''PwAccident:write'])]
  62.     #[ORM\Column(length50uniquetrue)]
  63.     private ?string $hash null;
  64.     public function getId(): ?int
  65.     {
  66.         return $this->id;
  67.     }
  68.     public function getCodeOtg(): ?string
  69.     {
  70.         return $this->code_otg;
  71.     }
  72.     public function setCodeOtg(?string $code_otg): static
  73.     {
  74.         $this->code_otg $code_otg;
  75.         return $this;
  76.     }
  77.     public function getCity(): ?PwCity
  78.     {
  79.         return $this->city;
  80.     }
  81.     public function setCity(?PwCity $city): static
  82.     {
  83.         $this->city $city;
  84.         return $this;
  85.     }
  86.     public function getStreet(): ?PwStreet
  87.     {
  88.         return $this->street;
  89.     }
  90.     public function setStreet(?PwStreet $street): static
  91.     {
  92.         $this->street $street;
  93.         return $this;
  94.     }
  95.     public function getDateEvent(): ?\DateTimeInterface
  96.     {
  97.         return $this->dateEvent;
  98.     }
  99.     public function setDateEvent(?\DateTimeInterface $dateEvent): static
  100.     {
  101.         $this->dateEvent $dateEvent;
  102.         return $this;
  103.     }
  104.     public function getDatePlanIn(): ?\DateTimeInterface
  105.     {
  106.         return $this->datePlanIn;
  107.     }
  108.     public function setDatePlanIn(?\DateTimeInterface $datePlanIn): static
  109.     {
  110.         $this->datePlanIn $datePlanIn;
  111.         return $this;
  112.     }
  113.     public function getKoment(): ?string
  114.     {
  115.         return $this->koment;
  116.     }
  117.     public function setKoment(?string $koment): static
  118.     {
  119.         $this->koment $koment;
  120.         return $this;
  121.     }
  122.     public function getSwitchSubReason(): ?int
  123.     {
  124.         return $this->switchSubReason;
  125.     }
  126.     public function setSwitchSubReason(?int $switchSubReason): static
  127.     {
  128.         $this->switchSubReason $switchSubReason;
  129.         return $this;
  130.     }
  131.     public function getOtg(): ?PwOtg
  132.     {
  133.         return $this->otg;
  134.     }
  135.     public function setOtg(?PwOtg $otg): static
  136.     {
  137.         $this->otg $otg;
  138.         return $this;
  139.     }
  140.     public function getBuildingNames(): ?string
  141.     {
  142.         return $this->buildingNames;
  143.     }
  144.     public function setBuildingNames(?string $buildingNames): static
  145.     {
  146.         $this->buildingNames $buildingNames;
  147.         return $this;
  148.     }
  149.     public function getTypeOff(): ?int
  150.     {
  151.         return $this->typeOff;
  152.     }
  153.     public function setTypeOff(?int $typeOff): static
  154.     {
  155.         $this->typeOff $typeOff;
  156.         return $this;
  157.     }
  158.     public function getDno(): ?string
  159.     {
  160.         return $this->dno;
  161.     }
  162.     public function setDno(?string $dno): static
  163.     {
  164.         $this->dno $dno;
  165.         return $this;
  166.     }
  167.     public function getHash(): ?string
  168.     {
  169.         return $this->hash;
  170.     }
  171.     public function setHash(?string $hash): static
  172.     {
  173.         $this->hash $hash;
  174.         return $this;
  175.     }
  176. }