src/Entity/RequestRegistration.php line 19

Open in your IDE?
  1. <?php
  2.     namespace App\Entity;
  3.     use App\Repository\RequestRegistrationRepository;
  4.     use App\Traits\DateTrait;
  5.     use Doctrine\ORM\Mapping as ORM;
  6.     use JMS\Serializer\Annotation as Serializer;
  7.     use JMS\Serializer\Annotation\Expose;
  8.     use JMS\Serializer\Annotation\Groups;
  9.     /**
  10.      * Entity pour les inscriptions qui ont besoin d'une validation
  11.      *
  12.      * @ORM\Entity(repositoryClass=RequestRegistrationRepository::class)
  13.      *
  14.      * @Serializer\ExclusionPolicy("ALL")
  15.      */
  16.     class RequestRegistration
  17.     {
  18.         /**
  19.          * @ORM\Id
  20.          * @ORM\GeneratedValue
  21.          * @ORM\Column(type="integer")
  22.          *
  23.          * @Expose
  24.          * @Groups({
  25.          *     "request_registration:id",
  26.          *     "request_registration", "export_request_registration_datatable"
  27.          * })
  28.          */
  29.         private ?int $id NULL;
  30.         /**
  31.          * Utilisateur qui fait la validation
  32.          *
  33.          * @ORM\OneToOne(targetEntity=User::class, mappedBy="requestRegistration", cascade={"persist"})
  34.          * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  35.          *
  36.          * @Expose
  37.          * @Groups({
  38.          *     "request_registration:user",
  39.          *     "request_registration", "export_request_registration_datatable"
  40.          * })
  41.          */
  42.         private ?User $user;
  43.         /**
  44.          * Personne assignée à valider l'inscription
  45.          *
  46.          * @ORM\ManyToOne(targetEntity=User::class, inversedBy="requestRegistrationsToValidate")
  47.          *
  48.          * @Expose
  49.          * @Groups({
  50.          *     "request_registration:referent",
  51.          *     "request_registration", "export_request_registration_datatable"
  52.          * })
  53.          */
  54.         private ?User $referent NULL;
  55.         /**
  56.          * Inscription validée ou non
  57.          * @ORM\Column(type="boolean", nullable=true)
  58.          *
  59.          * @Expose
  60.          * @Groups({
  61.          *     "request_registration:accepted",
  62.          *     "request_registration", "export_request_registration_datatable"
  63.          * })
  64.          */
  65.         private ?bool $accepted NULL;
  66.         use DateTrait;
  67.         public function getId(): ?int
  68.         {
  69.             return $this->id;
  70.         }
  71.         public function getUser(): ?User
  72.         {
  73.             return $this->user;
  74.         }
  75.         public function setUser(User $user): self
  76.         {
  77.             $this->user $user;
  78.             return $this;
  79.         }
  80.         public function getReferent(): ?User
  81.         {
  82.             return $this->referent;
  83.         }
  84.         public function setReferent(?User $referent): self
  85.         {
  86.             $this->referent $referent;
  87.             return $this;
  88.         }
  89.         public function isAccepted(): ?bool
  90.         {
  91.             return $this->accepted;
  92.         }
  93.         public function setAccepted(?bool $accepted): self
  94.         {
  95.             $this->accepted $accepted;
  96.             return $this;
  97.         }
  98.     }