src/Entity/PwAccidentHistory.php line 23

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. #[ORM\Entity(repositoryClassPwAccidentHistoryRepository::class)]
  12. #[ApiResource(
  13.     normalizationContext: ['groups' => ['PwAccident:read']],
  14.     denormalizationContext: ['groups' => ['PwAccident:write']],
  15.     order: ['dateEvent' => 'ASC'],
  16. )]
  17. #[ApiFilter(SearchFilter::class, properties: ['city.id' => 'exact''street.id' => 'exact''otg.id' => 'exact' 'typeOff' => 'exact''switchSubReason' => 'exact'])]
  18. #[ApiFilter(DateFilter::class, properties: ['datePlanIn'])]
  19. class PwAccidentHistory
  20. {
  21.     #[ORM\Id]
  22.     #[ORM\GeneratedValue(strategy'IDENTITY')]
  23.     #[ORM\Column]
  24.     #[Groups(['PwAccident:read''PwAccident:write'])]
  25.     private ?int $id null;
  26.     #[Groups(['PwAccident:read''PwAccident:write'])]
  27.     #[ORM\Column(length255nullabletrue)]
  28.     private ?string $code_otg null;
  29.     #[Groups(['PwAccident:read''PwAccident:write'])]
  30.     #[ORM\ManyToOne(inversedBy'pwAccidents')]
  31.     private ?PwCity $city null;
  32.     #[Groups(['PwAccident:read''PwAccident:write'])]
  33.     #[ORM\ManyToOne(inversedBy'pwAccidents')]
  34.     private ?PwStreet $street null;
  35.     #[Groups(['PwAccident:read''PwAccident:write'])]
  36.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  37.     private ?\DateTimeInterface $dateEvent null;
  38.     #[Groups(['PwAccident:read''PwAccident:write'])]
  39.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  40.     private ?\DateTimeInterface $datePlanIn null;
  41.     #[Groups(['PwAccident:read''PwAccident:write'])]
  42.     #[ORM\Column(length255nullabletrue)]
  43.     private ?string $koment null;
  44.     #[Groups(['PwAccident:read''PwAccident:write'])]
  45.     #[ORM\Column(typeTypes::SMALLINTnullabletrue)]
  46.     private ?int $switchSubReason null;
  47.     #[Groups(['PwAccident:read''PwAccident:write'])]
  48.     #[ORM\ManyToOne(inversedBy'pwAccidents')]
  49.     #[ORM\JoinColumn(nullablefalse)]
  50.     private ?PwOtg $otg null;
  51.     #[Groups(['PwAccident:read''PwAccident:write'])]
  52.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  53.     private ?string $buildingNames null;
  54.     #[Groups(['PwAccident:read''PwAccident:write'])]
  55.     #[ORM\Column]
  56.     private ?int $typeOff null;
  57.     #[Groups(['PwAccident:read''PwAccident:write'])]
  58.     #[ORM\Column(length255nullabletrue)]
  59.     private ?string $dno null;
  60.     #[Groups(['PwAccident:read''PwAccident:write'])]
  61.     #[ORM\Column(length50,  uniquetrue)]
  62.     private ?string $hash null;
  63.     public function getId(): ?int
  64.     {
  65.         return $this->id;
  66.     }
  67.     public function getCodeOtg(): ?string
  68.     {
  69.         return $this->code_otg;
  70.     }
  71.     public function setCodeOtg(?string $code_otg): static
  72.     {
  73.         $this->code_otg $code_otg;
  74.         return $this;
  75.     }
  76.     public function getCity(): ?PwCity
  77.     {
  78.         return $this->city;
  79.     }
  80.     public function setCity(?PwCity $city): static
  81.     {
  82.         $this->city $city;
  83.         return $this;
  84.     }
  85.     public function getStreet(): ?PwStreet
  86.     {
  87.         return $this->street;
  88.     }
  89.     public function setStreet(?PwStreet $street): static
  90.     {
  91.         $this->street $street;
  92.         return $this;
  93.     }
  94.     public function getDateEvent(): ?\DateTimeInterface
  95.     {
  96.         return $this->dateEvent;
  97.     }
  98.     public function setDateEvent(?\DateTimeInterface $dateEvent): static
  99.     {
  100.         $this->dateEvent $dateEvent;
  101.         return $this;
  102.     }
  103.     public function getDatePlanIn(): ?\DateTimeInterface
  104.     {
  105.         return $this->datePlanIn;
  106.     }
  107.     public function setDatePlanIn(?\DateTimeInterface $datePlanIn): static
  108.     {
  109.         $this->datePlanIn $datePlanIn;
  110.         return $this;
  111.     }
  112.     public function getKoment(): ?string
  113.     {
  114.         return $this->koment;
  115.     }
  116.     public function setKoment(?string $koment): static
  117.     {
  118.         $this->koment $koment;
  119.         return $this;
  120.     }
  121.     public function getSwitchSubReason(): ?int
  122.     {
  123.         return $this->switchSubReason;
  124.     }
  125.     public function setSwitchSubReason(?int $switchSubReason): static
  126.     {
  127.         $this->switchSubReason $switchSubReason;
  128.         return $this;
  129.     }
  130.     public function getOtg(): ?PwOtg
  131.     {
  132.         return $this->otg;
  133.     }
  134.     public function setOtg(?PwOtg $otg): static
  135.     {
  136.         $this->otg $otg;
  137.         return $this;
  138.     }
  139.     public function getBuildingNames(): ?string
  140.     {
  141.         return $this->buildingNames;
  142.     }
  143.     public function setBuildingNames(?string $buildingNames): static
  144.     {
  145.         $this->buildingNames $buildingNames;
  146.         return $this;
  147.     }
  148.     public function getTypeOff(): ?int
  149.     {
  150.         return $this->typeOff;
  151.     }
  152.     public function setTypeOff(int $typeOff): static
  153.     {
  154.         $this->typeOff $typeOff;
  155.         return $this;
  156.     }
  157.     public function getDno(): ?string
  158.     {
  159.         return $this->dno;
  160.     }
  161.     public function setDno(?string $dno): static
  162.     {
  163.         $this->dno $dno;
  164.         return $this;
  165.     }
  166.     public function getHash(): ?string
  167.     {
  168.         return $this->hash;
  169.     }
  170.     public function setHash(string $hash): static
  171.     {
  172.         $this->hash $hash;
  173.         return $this;
  174.     }
  175. }