src/Entity/ParentActivationHistory.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\Timestampable;
  4. use App\Repository\ParentActivationHistoryRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * Historique des activations/désactivations de comptes parents
  8.  * (fonctionnalité super-admin — voir ParentActivationService). Une ligne par
  9.  * action, jamais modifiée après coup (contrairement à ScolarityHistory, il
  10.  * n'y a pas de notion de "correction" ici).
  11.  */
  12. #[ORM\Entity(repositoryClassParentActivationHistoryRepository::class)]
  13. #[ORM\HasLifecycleCallbacks]
  14. class ParentActivationHistory
  15. {
  16.     use Timestampable;
  17.     public const ACTION_ACTIVATED 'activated';
  18.     public const ACTION_DEACTIVATED 'deactivated';
  19.     #[ORM\Id]
  20.     #[ORM\GeneratedValue]
  21.     #[ORM\Column]
  22.     private ?int $id null;
  23.     #[ORM\ManyToOne]
  24.     #[ORM\JoinColumn(nullablefalse)]
  25.     private ?User $parent null;
  26.     #[ORM\ManyToOne]
  27.     #[ORM\JoinColumn(nullablefalse)]
  28.     private ?School $school null;
  29.     // Qui a effectué l'action : le super-admin, ou un titulaire de
  30.     // ROLE_ACTIVATION_VIEWER habilité (canManageActivation = true).
  31.     #[ORM\ManyToOne]
  32.     #[ORM\JoinColumn(nullablefalse)]
  33.     private ?User $author null;
  34.     #[ORM\Column(length20)]
  35.     private ?string $action null;
  36.     public function getId(): ?int
  37.     {
  38.         return $this->id;
  39.     }
  40.     public function getParent(): ?User
  41.     {
  42.         return $this->parent;
  43.     }
  44.     public function setParent(?User $parent): static
  45.     {
  46.         $this->parent $parent;
  47.         return $this;
  48.     }
  49.     public function getSchool(): ?School
  50.     {
  51.         return $this->school;
  52.     }
  53.     public function setSchool(?School $school): static
  54.     {
  55.         $this->school $school;
  56.         return $this;
  57.     }
  58.     public function getAuthor(): ?User
  59.     {
  60.         return $this->author;
  61.     }
  62.     public function setAuthor(?User $author): static
  63.     {
  64.         $this->author $author;
  65.         return $this;
  66.     }
  67.     public function getAction(): ?string
  68.     {
  69.         return $this->action;
  70.     }
  71.     public function setAction(string $action): static
  72.     {
  73.         $this->action $action;
  74.         return $this;
  75.     }
  76. }