<?phpnamespace App\Entity\Training;use ApiPlatform\Core\Annotation\ApiResource;use App\Repository\Training\NoteRepository;use App\Entity\Training\Noteassign;use App\Entity\Training\Trainee;use App\Traits\Actions;use DateTime;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: NoteRepository::class)]#[ORM\Table(name: 'hs_tc_training_note')]#[ApiResource]class Note{ use Actions; #[ORM\ManyToOne(targetEntity: "Noteassign", inversedBy: "notes")] #[ORM\JoinColumn(nullable: false)] private Noteassign $noteassign; #[ORM\ManyToOne(targetEntity: "Trainee", inversedBy: "notes")] #[ORM\JoinColumn(nullable: false)] private Trainee $trainee; #[ORM\Column(name: "val", type: "float", nullable: true)] private ?float $val=0; #[ORM\Column(name: "update_at", type: "datetime", nullable: true)] private DateTime $updateAt; #[ORM\Column(name: "remarque", type: "string", length: 255, nullable: true)] private ?string $remarque = null; public function __construct() { // date_default_timezone_set('Africa/Casablanca'); $this->createAt=new \DateTime('now'); $this->updateAt=new \DateTime('now'); $this->published=false; } /** * @return float */ public function getVal(): ?float { return $this->val; } /** * @param float $val */ public function setVal(?float $val): Note { $this->val = $val; return $this; } /** * @return DateTime */ public function getUpdateAt(): ?DateTime { return $this->updateAt; } /** * @param DateTime $updateAt * @ORM\PostUpdate() */ public function setUpdateAt(): Note { // date_default_timezone_set('Africa/Casablanca'); $this->updateAt=new \DateTime('now'); return $this; } /** * @return Trainee */ public function getTrainee(): ?Trainee { return $this->trainee; } /** * @param Trainee $trainee */ public function setTrainee(?Trainee $trainee): Note { $this->trainee = $trainee; return $this; } /** * @return string */ public function getRemarque(): ?string { return $this->remarque; } /** * @param string $remarque */ public function setRemarque(?string $remarque): Note { $this->remarque = $remarque; return $this; } /** * @return Noteassign */ public function getNoteassign(): ?Noteassign { return $this->noteassign; } /** * @param Noteassign $noteassign */ public function setNoteassign(?Noteassign $noteassign): Note { $this->noteassign = $noteassign; return $this; }}