src/Entity/ServiceOrderHistory.php line 25

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\ServiceOrderHistoryRepository;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use ApiPlatform\Metadata\ApiFilter;
  8. use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
  9. use Symfony\Component\Serializer\Annotation\Groups;
  10. use Symfony\Component\Serializer\Annotation\MaxDepth;
  11. use ApiPlatform\Core\Annotation\ApiProperty;
  12. #[ORM\Entity(repositoryClassServiceOrderHistoryRepository::class)]
  13. #[ApiResource(
  14.     normalizationContext: ['groups' => ['service_history:read']],
  15.     denormalizationContext: ['groups' => ['service_history:write']],
  16.     order: ['id' => 'DESC'],
  17. )]
  18. #[ApiFilter(SearchFilter::class, properties: [
  19.     'personalAccount.id' => 'exact'
  20.     'personalAccount.owner.id' => 'exact'
  21. ])]
  22. class ServiceOrderHistory
  23. {
  24.     #[ORM\Id]
  25.     #[ORM\GeneratedValue]
  26.     #[ORM\Column]
  27.     #[Groups(['service_history:read''service_history:write'])]
  28.     private ?int $id null;
  29.     #[Groups(['service_history:read''service_history:write'])]
  30.     #[ORM\Column(length255nullabletrue)]
  31.     private ?string $name null;
  32.     #[Groups(['service_history:read''service_history:write'])]
  33.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  34.     private ?\DateTimeInterface $dateEntered null;
  35.     #[Groups(['service_history:read''service_history:write'])]
  36.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  37.     private ?\DateTimeInterface $dateModified null;
  38.     #[Groups(['service_history:read''service_history:write'])]
  39.     #[ORM\Column(length100nullabletrue)]
  40.     private ?string $type null;
  41.     #[Groups(['service_history:read''service_history:write'])]
  42.     #[ORM\Column(length100nullabletrue)]
  43.     private ?string $status null;
  44.     #[ORM\ManyToOne(inversedBy'serviceOrderHistories')]
  45.     private ?AppPersonalAccount $personalAccount null;
  46.     #[Groups(['service_history:read''service_history:write'])]
  47.     #[ORM\Column(length255nullabletrue)]
  48.     private ?string $pdf null;
  49.     #[Groups(['service_history:read''service_history:write'])]
  50.     #[ORM\Column(length100nullabletrue)]
  51.     private ?string $idCrm null;
  52.     #[Groups(['service_history:read''service_history:write'])]
  53.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  54.     private ?string $description null;
  55.     public function getId(): ?int
  56.     {
  57.         return $this->id;
  58.     }
  59.     public function getName(): ?string
  60.     {
  61.         return $this->name;
  62.     }
  63.     public function setName(?string $name): static
  64.     {
  65.         $this->name $name;
  66.         return $this;
  67.     }
  68.     public function getDateEntered(): ?\DateTimeInterface
  69.     {
  70.         return $this->dateEntered;
  71.     }
  72.     public function setDateEntered(?\DateTimeInterface $dateEntered): static
  73.     {
  74.         $this->dateEntered $dateEntered;
  75.         return $this;
  76.     }
  77.     public function getDateModified(): ?\DateTimeInterface
  78.     {
  79.         return $this->dateModified;
  80.     }
  81.     public function setDateModified(?\DateTimeInterface $dateModified): static
  82.     {
  83.         $this->dateModified $dateModified;
  84.         return $this;
  85.     }
  86.     public function getType(): ?string
  87.     {
  88.         return $this->type;
  89.     }
  90.     public function setType(?string $type): static
  91.     {
  92.         $this->type $type;
  93.         return $this;
  94.     }
  95.     public function getStatus(): ?string
  96.     {
  97.         return $this->status;
  98.     }
  99.     public function setStatus(?string $status): static
  100.     {
  101.         $this->status $status;
  102.         return $this;
  103.     }
  104.     public function getPersonalAccount(): ?AppPersonalAccount
  105.     {
  106.         return $this->personalAccount;
  107.     }
  108.     public function setPersonalAccount(?AppPersonalAccount $personalAccount): static
  109.     {
  110.         $this->personalAccount $personalAccount;
  111.         return $this;
  112.     }
  113.     public function getPdf(): ?string
  114.     {
  115.         return $this->pdf;
  116.     }
  117.     public function setPdf(?string $pdf): static
  118.     {
  119.         $this->pdf $pdf;
  120.         return $this;
  121.     }
  122.     public function getIdCrm(): ?string
  123.     {
  124.         return $this->idCrm;
  125.     }
  126.     public function setIdCrm(?string $idCrm): static
  127.     {
  128.         $this->idCrm $idCrm;
  129.         return $this;
  130.     }
  131.     public function getDescription(): ?string
  132.     {
  133.         return $this->description;
  134.     }
  135.     public function setDescription(?string $description): static
  136.     {
  137.         $this->description $description;
  138.         return $this;
  139.     }
  140. }