<?phpnamespace App\Entity\Training;use ApiPlatform\Core\Annotation\ApiResource;use App\Repository\Training\CrevalRepository;use App\Traits\Actions;use App\Entity\Training\Nsti;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: CrevalRepository::class)]#[ORM\Table(name: 'hs_tc_training_creval')]#[ApiResource]class Creval implements \Stringable{ use Actions; #[ORM\Column(name: "name", type: "string", length: 255)] private $name; #[ORM\Column(name: "abbrev", type: "string", length: 255)] private ?string $abbrev = null; #[ORM\Column(name: "coefficient", type: "integer", length: 255)] private ?int $coefficient = null; #[ORM\OneToMany(mappedBy: "creval", targetEntity: Nsti::class, cascade: ["persist"], orphanRemoval: true)] private Collection $nstis; public function __construct() { // date_default_timezone_set('Africa/Casablanca'); $this->createAt=new \DateTime('now'); $this->published=false; $this->nstis=new ArrayCollection(); } /** * @return string */ public function getAbbrev(): ?string { return $this->abbrev; } /** * @param string $abbrev */ public function setAbbrev(?string $abbrev): Creval { $this->abbrev = $abbrev; return $this; } /** * Set nom * * @param string $name * @return Creval */ public function setName($name) { $this->name = $name; return $this; } /** * Get name * * @return string */ public function getName() { return $this->name; } function __toString(): string { return (string) $this->name; } /** * @return integer */ public function getCoefficient(): ?int { return $this->coefficient; } /** * @param integer $coefficient */ public function setCoefficient(?int $coefficient): Creval { $this->coefficient = $coefficient; return $this; } /** * Add nsti * * * @return Creval */ public function addNsti(Nsti $nsti) { $nsti->setCreval($this); $this->nstis[] = $nsti; return $this; } /** * Remove nsti */ public function removeNsti(Nsti $nsti) { $this->nstis->removeElement($nsti); } /** * Get nstis * * @return Collection */ public function getNstis() { return $this->nstis; }}