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/User.php
<?php namespace App\Entity; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use FOS\UserBundle\Model\User as BaseUser; use Doctrine\ORM\Mapping as ORM; /** * @ORM\Entity * @ORM\Table(name="user") */ class User extends BaseUser { /** * @ORM\Id * @ORM\Column(type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ protected $id; /** * @ORM\Column(type="string", length=255) */ private $firstname; /** * @ORM\Column(type="string", length=255) */ private $lastname; /** * @ORM\Column(type="string", length=255) */ private $phone; /** * @ORM\ManyToMany(targetEntity=Formation::class, inversedBy="users") */ private $formation; /** * @ORM\OneToMany(targetEntity=Command::class, mappedBy="user") */ private $commands; /** * @ORM\OneToMany(targetEntity=ProgressFormation::class, mappedBy="user") */ private $progressFormations; /** * @ORM\OneToMany(targetEntity=CommandCoaching::class, mappedBy="user") */ private $commandCoachings; public function __construct() { parent::__construct(); $this->username = "Username"; $this->formation = new ArrayCollection(); $this->commands = new ArrayCollection(); $this->progressFormations = new ArrayCollection(); $this->commandCoachings = new ArrayCollection(); } public function isGranted($role) { return in_array($role, $this->getRoles()); } public function getFirstname(): ?string { return $this->firstname; } public function setFirstname(string $firstname): self { $this->firstname = $firstname; return $this; } public function getLastname(): ?string { return $this->lastname; } public function setLastname(string $lastname): self { $this->lastname = $lastname; return $this; } public function getPhone(): ?string { return $this->phone; } public function setPhone(string $phone): self { $this->phone = $phone; return $this; } public function fullname(){ return $this->firstname . " " . $this->lastname; } /** * @return Collection|Formation[] */ public function getFormation(): Collection { return $this->formation; } public function addFormation(Formation $formation): self { if (!$this->formation->contains($formation)) { $this->formation[] = $formation; } return $this; } public function removeFormation(Formation $formation): self { $this->formation->removeElement($formation); return $this; } /** * @return Collection|Command[] */ public function getCommands(): Collection { return $this->commands; } public function addCommand(Command $command): self { if (!$this->commands->contains($command)) { $this->commands[] = $command; $command->setUser($this); } return $this; } public function removeCommand(Command $command): self { if ($this->commands->removeElement($command)) { // set the owning side to null (unless already changed) if ($command->getUser() === $this) { $command->setUser(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->setUser($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->getUser() === $this) { $progressFormation->setUser(null); } } 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->setUser($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->getUser() === $this) { $commandCoaching->setUser(null); } } return $this; } }