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/Coaching.php
<?php namespace App\Entity; use App\Repository\CoachingRepository; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use Vich\UploaderBundle\Mapping\Annotation as Vich; use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\HttpFoundation\File\File; /** * @ORM\Entity(repositoryClass=CoachingRepository::class) * @Vich\Uploadable */ class Coaching { /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $title; /** * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true) */ private $price; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $shortDescription; /** * @ORM\Column(type="integer") */ private $coachingOrder; /** * NOTE: This is not a mapped field of entity metadata, just a simple property. * * @Vich\UploadableField(mapping="coaching_images", fileNameProperty="imageName") * * @var File */ private $imageFile; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $imageName; /** * @ORM\Column(type="datetime") */ private $createdAt; /** * @ORM\Column(type="datetime", nullable=true) */ private $updatedAt; /** * @ORM\ManyToOne(targetEntity=CategoryCoaching::class, inversedBy="coachings") * @ORM\JoinColumn(nullable=false) */ private $categoryCoaching; /** * @ORM\Column(type="boolean") */ private $isActive; /** * @ORM\ManyToOne(targetEntity=CoachingType::class, inversedBy="coachings") */ private $coachingType; /** * @ORM\OneToMany(targetEntity=CommandCoaching::class, mappedBy="coaching") */ private $commandCoachings; /** * @ORM\Column(type="text", nullable=true) */ private $informations; public function __construct() { $this->createdAt = new \DateTime(); $this->setIsActive(1); $this->commandCoachings = new ArrayCollection(); } public function __toString() { return $this->getTitle(); } public function getId(): ?int { return $this->id; } public function getTitle(): ?string { return $this->title; } public function setTitle(string $title): self { $this->title = $title; return $this; } public function getPrice(): ?string { return $this->price; } public function setPrice(?string $price): self { $this->price = $price; return $this; } public function getShortDescription(): ?string { return $this->shortDescription; } public function setShortDescription(?string $shortDescription): self { $this->shortDescription = $shortDescription; return $this; } public function getCoachingOrder(): ?int { return $this->coachingOrder; } public function setCoachingOrder(int $coachingOrder): self { $this->coachingOrder = $coachingOrder; 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 getImageName(): ?string { return $this->imageName; } public function setImageName(?string $imageName): self { $this->imageName = $imageName; return $this; } public function getCreatedAt(): ?\DateTimeInterface { return $this->createdAt; } public function setCreatedAt(\DateTimeInterface $createdAt): self { $this->createdAt = $createdAt; return $this; } public function getUpdatedAt(): ?\DateTimeInterface { return $this->updatedAt; } public function setUpdatedAt(?\DateTimeInterface $updatedAt): self { $this->updatedAt = $updatedAt; return $this; } public function getCategoryCoaching(): ?CategoryCoaching { return $this->categoryCoaching; } public function setCategoryCoaching(?CategoryCoaching $categoryCoaching): self { $this->categoryCoaching = $categoryCoaching; return $this; } public function getIsActive(): ?bool { return $this->isActive; } public function setIsActive(bool $isActive): self { $this->isActive = $isActive; return $this; } public function getCoachingType(): ?CoachingType { return $this->coachingType; } public function setCoachingType(?CoachingType $coachingType): self { $this->coachingType = $coachingType; return $this; } /** * @return Collection|CommandCoaching[] */ public function getCommandCoachings(): Collection { return $this->commandCoachings; } public function addCommandCoaching(CommandCoaching $commandCoaching): self { if (!$this->commandCoachings->contains($commandCoaching)) { $this->commandCoachings[] = $commandCoaching; $commandCoaching->setCoaching($this); } return $this; } public function removeCommandCoaching(CommandCoaching $commandCoaching): self { if ($this->commandCoachings->removeElement($commandCoaching)) { // set the owning side to null (unless already changed) if ($commandCoaching->getCoaching() === $this) { $commandCoaching->setCoaching(null); } } return $this; } public function getInformations(): ?string { return $this->informations; } public function setInformations(?string $informations): self { $this->informations = $informations; return $this; } }