Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
srv
/
data
/
web
/
vhosts
/
www.coaching-en-developpement-personnel.fr
/
htdocs
/
src
/
Entity
/
/srv/data/web/vhosts/www.coaching-en-developpement-personnel.fr/htdocs/src/Entity/Formation.php
<?php namespace App\Entity; use Doctrine\ORM\Mapping as ORM; use App\Repository\FormationRepository; use Doctrine\Common\Collections\Collection; use Symfony\Component\HttpFoundation\File\File; use Doctrine\Common\Collections\ArrayCollection; use Vich\UploaderBundle\Mapping\Annotation as Vich; use Symfony\Component\Validator\Constraints as Assert; use Vich\UploaderBundle\Mapping\Annotation\Uploadable; /** * @ORM\Entity(repositoryClass=FormationRepository::class) * @Vich\Uploadable */ class Formation { /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $name; /** * @ORM\Column(type="string", length=45) */ private $duration; /** * @ORM\OneToMany(targetEntity=Chapter::class, mappedBy="formation") */ private $chapters; /** * @ORM\ManyToOne(targetEntity=Category::class, inversedBy="formations") * @ORM\JoinColumn(nullable=false) */ private $category; /** * @ORM\Column(type="datetime") */ private $createdAt; /** * @ORM\Column(type="datetime", nullable=true) */ private $updateAt; /** * @ORM\Column(type="decimal", precision=5, scale=2) * @Assert\LessThan( * value = 99999 * ) */ private $price; /** * @ORM\Column(type="boolean") */ private $isDelete; /** * NOTE: This is not a mapped field of entity metadata, just a simple property. * * @Vich\UploadableField(mapping="formation_images", fileNameProperty="imageName") * * @var File */ private $imageFile; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $imageName; /** * @ORM\Column(type="text", nullable=true) */ private $description; /** * @ORM\ManyToMany(targetEntity=User::class, mappedBy="formation") */ private $users; /** * @ORM\OneToMany(targetEntity=CommandFormation::class, mappedBy="formation") */ private $commandFormations; /** * @ORM\OneToMany(targetEntity=ProgressFormation::class, mappedBy="formation") */ private $progressFormations; /** * @ORM\Column(type="text", nullable=true) */ private $congratulationMessage; /** * @ORM\Column(type="boolean", nullable=true) */ private $isOnline; public function __construct() { $this->chapters = new ArrayCollection(); $this->createdAt = new \DateTime(); $this->setIsDelete(0); $this->users = new ArrayCollection(); $this->commandFormations = new ArrayCollection(); $this->progressFormations = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } public function getDuration(): ?string { return $this->duration; } public function setDuration(string $duration): self { $this->duration = $duration; return $this; } /** * @return Collection|Chapter[] */ public function getChapters(): Collection { return $this->chapters; } public function addChapter(Chapter $chapter): self { if (!$this->chapters->contains($chapter)) { $this->chapters[] = $chapter; $chapter->setFormation($this); } return $this; } public function removeChapter(Chapter $chapter): self { if ($this->chapters->removeElement($chapter)) { // set the owning side to null (unless already changed) if ($chapter->getFormation() === $this) { $chapter->setFormation(null); } } return $this; } public function getCategory(): ?Category { return $this->category; } public function setCategory(?Category $category): self { $this->category = $category; return $this; } public function getCreatedAt(): ?\DateTimeInterface { return $this->createdAt; } public function setCreatedAt(\DateTimeInterface $createdAt): self { $this->createdAt = $createdAt; return $this; } public function getUpdateAt(): ?\DateTimeInterface { return $this->updateAt; } public function setUpdateAt(?\DateTimeInterface $updateAt): self { $this->updateAt = $updateAt; return $this; } public function getPrice(): ?string { return $this->price; } public function setPrice(string $price): self { $this->price = $price; return $this; } public function getIsDelete(): ?bool { return $this->isDelete; } public function setIsDelete(bool $isDelete): self { $this->isDelete = $isDelete; return $this; } public function getImageName(): ?string { return $this->imageName; } public function setImageName(?string $imageName): self { $this->imageName = $imageName; return $this; } /** * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile $imageFile * */ public function setimageFile(?File $imageFile = null): void { $this->imageFile = $imageFile; if (null !== $imageFile) { // It is required that at least one field changes if you are using doctrine // otherwise the event listeners won't be called and the file is lost $this->updatedAt = new \DateTimeImmutable(); } } public function getImageFile(): ?File { return $this->imageFile; } public function getDescription(): ?string { return $this->description; } public function setDescription(?string $description): self { $this->description = $description; return $this; } /** * @return Collection|User[] */ public function getUsers(): Collection { return $this->users; } public function addUser(User $user): self { if (!$this->users->contains($user)) { $this->users[] = $user; $user->addFormation($this); } return $this; } public function removeUser(User $user): self { if ($this->users->removeElement($user)) { $user->removeFormation($this); } return $this; } /** * @return Collection|CommandFormation[] */ public function getCommandFormations(): Collection { return $this->commandFormations; } public function addCommandFormation(CommandFormation $commandFormation): self { if (!$this->commandFormations->contains($commandFormation)) { $this->commandFormations[] = $commandFormation; $commandFormation->setFormation($this); } return $this; } public function removeCommandFormation(CommandFormation $commandFormation): self { if ($this->commandFormations->removeElement($commandFormation)) { // set the owning side to null (unless already changed) if ($commandFormation->getFormation() === $this) { $commandFormation->setFormation(null); } } return $this; } /** * @return Collection|ProgressFormation[] */ public function getProgressFormations(): Collection { return $this->progressFormations; } public function addProgressFormation(ProgressFormation $progressFormation): self { if (!$this->progressFormations->contains($progressFormation)) { $this->progressFormations[] = $progressFormation; $progressFormation->setFormation($this); } return $this; } public function removeProgressFormation(ProgressFormation $progressFormation): self { if ($this->progressFormations->removeElement($progressFormation)) { // set the owning side to null (unless already changed) if ($progressFormation->getFormation() === $this) { $progressFormation->setFormation(null); } } return $this; } public function getCongratulationMessage(): ?string { return $this->congratulationMessage; } public function setCongratulationMessage(?string $congratulationMessage): self { $this->congratulationMessage = $congratulationMessage; return $this; } public function getIsOnline(): ?bool { return $this->isOnline; } public function setIsOnline(?bool $isOnline): self { $this->isOnline = $isOnline; return $this; } }