src/Entity/PwAccident.php line 20

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