src/Entity/LivretEvaluation.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\LivretEvaluationRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. /**
  7.  * @ORM\Entity(repositoryClass=LivretEvaluationRepository::class)
  8.  * @ORM\HasLifecycleCallbacks
  9.  */
  10. class LivretEvaluation
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="text")
  20.      */
  21.     private $commentaire;
  22.     /**
  23.      * @ORM\Column(type="json")
  24.      */
  25.     private $faits = [];
  26.     /**
  27.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="livretEvaluations")
  28.      * @ORM\JoinColumn(nullable=false)
  29.      */
  30.     private $eleve;
  31.     /**
  32.      * @ORM\ManyToOne(targetEntity=LivretAcquis::class, inversedBy="evaluations")
  33.      * @ORM\JoinColumn(nullable=false)
  34.      */
  35.     private $acquis;
  36.     /**
  37.      * @ORM\Column(type="date")
  38.      * @Gedmo\Timestampable(on="create")
  39.      */
  40.     private $created;
  41.     /**
  42.      * @ORM\Column(type="date")
  43.      * @Gedmo\Timestampable(on="update")
  44.      */
  45.     private $updated;
  46.     public function getId(): ?int
  47.     {
  48.         return $this->id;
  49.     }
  50.     public function getCommentaire(): ?string
  51.     {
  52.         return $this->commentaire;
  53.     }
  54.     public function setCommentaire(string $commentaire): self
  55.     {
  56.         $this->commentaire $commentaire;
  57.         return $this;
  58.     }
  59.     public function getFaits(): ?array
  60.     {
  61.         return $this->faits;
  62.     }
  63.     public function setFaits(array $faits): self
  64.     {
  65.         foreach ($faits as &$fait) {
  66.             if (in_array($fait,["true","false"], true)) $fait = ($fait === "true");
  67.             if (in_array($fait,["0","1"], true)) $fait = ($fait === "0");
  68.             if (in_array($fait,[0,1], true)) $fait = ($fait === 0);
  69.         }unset($fait);
  70.         $this->faits $faits;
  71.         return $this;
  72.     }
  73.     public function getEleve(): ?User
  74.     {
  75.         return $this->eleve;
  76.     }
  77.     public function setEleve(?User $eleve): self
  78.     {
  79.         $this->eleve $eleve;
  80.         return $this;
  81.     }
  82.     public function getEnseignant(): ?User
  83.     {
  84.         return $this->enseignant;
  85.     }
  86.     public function setEnseignant(?User $enseignant): self
  87.     {
  88.         $this->enseignant $enseignant;
  89.         return $this;
  90.     }
  91.     public function getAcquis(): ?LivretAcquis
  92.     {
  93.         return $this->acquis;
  94.     }
  95.     public function setAcquis(?LivretAcquis $acquis): self
  96.     {
  97.         $this->acquis $acquis;
  98.         return $this;
  99.     }
  100.     public function getCreated(): ?\DateTimeInterface
  101.     {
  102.         return $this->created;
  103.     }
  104.     public function setCreated(\DateTimeInterface $created): self
  105.     {
  106.         $this->created $created;
  107.         return $this;
  108.     }
  109.     public function getUpdated(): ?\DateTimeInterface
  110.     {
  111.         return $this->updated;
  112.     }
  113.     public function setUpdated(\DateTimeInterface $updated): self
  114.     {
  115.         $this->updated $updated;
  116.         return $this;
  117.     }
  118. }