PlaceRepair.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity\Place;
  4. use ApiPlatform\Metadata\ApiResource;
  5. use App\Entity\Access\Access;
  6. use App\Entity\Core\AbstractRepair;
  7. // use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
  8. use Doctrine\Common\Collections\ArrayCollection;
  9. use Doctrine\ORM\Mapping as ORM;
  10. /**
  11. * @todo : A la suite de la migration, il faut supprimer le nom de la table pour avoir une table PlaceRepair, et supprimer l'attribut discr.
  12. * @todo : migration table tag_repair
  13. *
  14. * Réparation effectuée sur un lieu (Place)
  15. */
  16. // #[Auditable]
  17. #[ApiResource(operations: [])]
  18. #[ORM\Entity]
  19. #[ORM\Table(name: 'Repair')]
  20. class PlaceRepair extends AbstractRepair
  21. {
  22. #[ORM\ManyToOne(inversedBy: 'placeRepairProviders')]
  23. #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
  24. protected ?Access $provider = null;
  25. #[ORM\ManyToOne(inversedBy: 'repairs')]
  26. protected ?Place $place = null;
  27. public function __construct()
  28. {
  29. $this->tags = new ArrayCollection();
  30. }
  31. public function getProvider(): ?Access
  32. {
  33. return $this->provider;
  34. }
  35. public function setProvider(?Access $provider): self
  36. {
  37. $this->provider = $provider;
  38. return $this;
  39. }
  40. public function getPlace(): ?Place
  41. {
  42. return $this->place;
  43. }
  44. public function setPlace(?Place $place): self
  45. {
  46. $this->place = $place;
  47. return $this;
  48. }
  49. }