src/Entity/Training/Note.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Training;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Repository\Training\NoteRepository;
  5. use App\Entity\Training\Noteassign;
  6. use App\Entity\Training\Trainee;
  7. use App\Traits\Actions;
  8. use DateTime;
  9. use Doctrine\ORM\Mapping as ORM;
  10. #[ORM\Entity(repositoryClassNoteRepository::class)]
  11. #[ORM\Table(name'hs_tc_training_note')]
  12. #[ApiResource]
  13. class Note
  14. {
  15.     use Actions;
  16.     #[ORM\ManyToOne(targetEntity"Noteassign"inversedBy"notes")]
  17.     #[ORM\JoinColumn(nullablefalse)]
  18.     private Noteassign $noteassign;
  19.     #[ORM\ManyToOne(targetEntity"Trainee"inversedBy"notes")]
  20.     #[ORM\JoinColumn(nullablefalse)]
  21.     private Trainee $trainee;
  22.     #[ORM\Column(name"val"type"float"nullabletrue)]
  23.     private ?float $val=0;
  24.     #[ORM\Column(name"update_at"type"datetime"nullabletrue)]
  25.     private DateTime $updateAt;
  26.     #[ORM\Column(name"remarque"type"string"length255nullabletrue)]
  27.     private ?string $remarque null;
  28.     public function __construct()
  29.     {
  30.         // date_default_timezone_set('Africa/Casablanca');
  31.         $this->createAt=new \DateTime('now');
  32.         $this->updateAt=new \DateTime('now');
  33.         $this->published=false;
  34.     }
  35.     /**
  36.      * @return float
  37.      */
  38.     public function getVal(): ?float
  39.     {
  40.         return $this->val;
  41.     }
  42.     /**
  43.      * @param float $val
  44.      */
  45.     public function setVal(?float $val): Note
  46.     {
  47.         $this->val $val;
  48.         return $this;
  49.     }
  50.     /**
  51.      * @return DateTime
  52.      */
  53.     public function getUpdateAt(): ?DateTime
  54.     {
  55.         return $this->updateAt;
  56.     }
  57.     /**
  58.      * @param DateTime $updateAt
  59.      * @ORM\PostUpdate()
  60.      */
  61.     public function setUpdateAt(): Note
  62.     {
  63.         // date_default_timezone_set('Africa/Casablanca');
  64.         $this->updateAt=new \DateTime('now');
  65.         return $this;
  66.     }
  67.     /**
  68.      * @return Trainee
  69.      */
  70.     public function getTrainee(): ?Trainee
  71.     {
  72.         return $this->trainee;
  73.     }
  74.     /**
  75.      * @param Trainee $trainee
  76.      */
  77.     public function setTrainee(?Trainee $trainee): Note
  78.     {
  79.         $this->trainee $trainee;
  80.         return $this;
  81.     }
  82.     /**
  83.      * @return string
  84.      */
  85.     public function getRemarque(): ?string
  86.     {
  87.         return $this->remarque;
  88.     }
  89.     /**
  90.      * @param string $remarque
  91.      */
  92.     public function setRemarque(?string $remarque): Note
  93.     {
  94.         $this->remarque $remarque;
  95.         return $this;
  96.     }
  97.     /**
  98.      * @return Noteassign
  99.      */
  100.     public function getNoteassign(): ?Noteassign
  101.     {
  102.         return $this->noteassign;
  103.     }
  104.     /**
  105.      * @param Noteassign $noteassign
  106.      */
  107.     public function setNoteassign(?Noteassign $noteassign): Note
  108.     {
  109.         $this->noteassign $noteassign;
  110.         return $this;
  111.     }
  112. }