PlaceRepair.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. class PlaceRepair extends AbstractRepair
  20. {
  21. #[ORM\ManyToOne(inversedBy: 'placeRepairProviders')]
  22. #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
  23. protected ?Access $provider = null;
  24. #[ORM\ManyToOne(inversedBy: 'repairs')]
  25. protected ?Place $place = null;
  26. public function __construct()
  27. {
  28. $this->tags = new ArrayCollection();
  29. }
  30. public function getProvider(): ?Access
  31. {
  32. return $this->provider;
  33. }
  34. public function setProvider(?Access $provider): self
  35. {
  36. $this->provider = $provider;
  37. return $this;
  38. }
  39. public function getPlace(): ?Place
  40. {
  41. return $this->place;
  42. }
  43. public function setPlace(?Place $place): self
  44. {
  45. $this->place = $place;
  46. return $this;
  47. }
  48. }