src/Entity/PwAccidentPlaned.php line 24

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\PwAccidentPlanedRepository;
  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(repositoryClassPwAccidentPlanedRepository::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' ])]
  18. #[ApiFilter(DateFilter::class, properties: ['datePlanIn'])]
  19. class PwAccidentPlaned
  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.     public function getId(): ?int
  58.     {
  59.         return $this->id;
  60.     }
  61.     public function getCodeOtg(): ?string
  62.     {
  63.         return $this->code_otg;
  64.     }
  65.     public function setCodeOtg(?string $code_otg): static
  66.     {
  67.         $this->code_otg $code_otg;
  68.         return $this;
  69.     }
  70.     public function getCity(): ?PwCity
  71.     {
  72.         return $this->city;
  73.     }
  74.     public function setCity(?PwCity $city): static
  75.     {
  76.         $this->city $city;
  77.         return $this;
  78.     }
  79.     public function getStreet(): ?PwStreet
  80.     {
  81.         return $this->street;
  82.     }
  83.     public function setStreet(?PwStreet $street): static
  84.     {
  85.         $this->street $street;
  86.         return $this;
  87.     }
  88.     public function getDateEvent(): ?\DateTimeInterface
  89.     {
  90.         return $this->dateEvent;
  91.     }
  92.     public function setDateEvent(?\DateTimeInterface $dateEvent): static
  93.     {
  94.         $this->dateEvent $dateEvent;
  95.         return $this;
  96.     }
  97.     public function getDatePlanIn(): ?\DateTimeInterface
  98.     {
  99.         return $this->datePlanIn;
  100.     }
  101.     public function setDatePlanIn(?\DateTimeInterface $datePlanIn): static
  102.     {
  103.         $this->datePlanIn $datePlanIn;
  104.         return $this;
  105.     }
  106.     public function getKoment(): ?string
  107.     {
  108.         return $this->koment;
  109.     }
  110.     public function setKoment(?string $koment): static
  111.     {
  112.         $this->koment $koment;
  113.         return $this;
  114.     }
  115.     public function getSwitchSubReason(): ?int
  116.     {
  117.         return $this->switchSubReason;
  118.     }
  119.     public function setSwitchSubReason(?int $switchSubReason): static
  120.     {
  121.         $this->switchSubReason $switchSubReason;
  122.         return $this;
  123.     }
  124.     public function getOtg(): ?PwOtg
  125.     {
  126.         return $this->otg;
  127.     }
  128.     public function setOtg(?PwOtg $otg): static
  129.     {
  130.         $this->otg $otg;
  131.         return $this;
  132.     }
  133.     public function getBuildingNames(): ?string
  134.     {
  135.         return $this->buildingNames;
  136.     }
  137.     public function setBuildingNames(?string $buildingNames): static
  138.     {
  139.         $this->buildingNames $buildingNames;
  140.         return $this;
  141.     }
  142.     public function getTypeOff(): ?int
  143.     {
  144.         return $this->typeOff;
  145.     }
  146.     public function setTypeOff(int $typeOff): static
  147.     {
  148.         $this->typeOff $typeOff;
  149.         return $this;
  150.     }
  151. }