src/Entity/User.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\UserRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use ARSHDF\UserBundle\Entity\User as UserBundle;
  8. /**
  9.  * @ORM\Entity(repositoryClass=UserRepository::class)
  10.  * @ORM\Table(name="`user`")
  11.  */
  12. class User extends UserBundle
  13. {
  14.     /**
  15.      * @ORM\Id
  16.      * @ORM\GeneratedValue
  17.      * @ORM\Column(type="integer")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\Column(type="string", length=50, nullable=true)
  22.      */
  23.     private $place;
  24.     /**
  25.      * @ORM\Column(type="string", length=50, nullable=true)
  26.      */
  27.     private $direction;
  28.     /**
  29.      * @ORM\ManyToOne(targetEntity=GestSite::class, inversedBy="users")
  30.      */
  31.     private $site;
  32.     /**
  33.      * @ORM\Column(type="integer", nullable=true)
  34.      */
  35.     private $tempo_user;
  36.     /**
  37.      * @ORM\OneToMany(targetEntity=Evenement::class, mappedBy="placeAppartientAgent")
  38.      */
  39.     private $evenements;
  40.     /**
  41.      * @ORM\OneToMany(targetEntity=Evenement::class, mappedBy="reserveParAgent")
  42.      */
  43.     private $reservePar;
  44.     /**
  45.      * @ORM\OneToMany(targetEntity=Alerte::class, mappedBy="user")
  46.      */
  47.     private $alertes;
  48.     /**
  49.      * @ORM\Column(type="string", length=255, nullable=true)
  50.      */
  51.     private $mail_perso;
  52.     public function __construct()
  53.     {
  54.         parent::__construct();
  55.         $this->evenements = new ArrayCollection();
  56.         $this->reservePar = new ArrayCollection();
  57.         $this->alertes = new ArrayCollection();
  58.     }
  59.     public function getId(): ?int
  60.     {
  61.         return $this->id;
  62.     }
  63.     public function getPlace(): ?string
  64.     {
  65.         return $this->place;
  66.     }
  67.     public function setPlace(?string $place): self
  68.     {
  69.         $this->place $place;
  70.         return $this;
  71.     }
  72.     public function getDirection(): ?string
  73.     {
  74.         return $this->direction;
  75.     }
  76.     public function setDirection(?string $direction): self
  77.     {
  78.         $this->direction $direction;
  79.         return $this;
  80.     }
  81.     public function getSite(): ?GestSite
  82.     {
  83.         return $this->site;
  84.     }
  85.     public function setSite(?GestSite $site): self
  86.     {
  87.         $this->site $site;
  88.         return $this;
  89.     }
  90.     public function getTempoUser(): ?int
  91.     {
  92.         return $this->tempo_user;
  93.     }
  94.     public function setTempoUser(?int $tempo_user): self
  95.     {
  96.         $this->tempo_user $tempo_user;
  97.         return $this;
  98.     }
  99.     /**
  100.      * @return Collection<int, Evenement>
  101.      */
  102.     public function getEvenements(): Collection
  103.     {
  104.         return $this->evenements;
  105.     }
  106.     public function addEvenement(Evenement $evenement): self
  107.     {
  108.         if (!$this->evenements->contains($evenement)) {
  109.             $this->evenements[] = $evenement;
  110.             $evenement->setPlaceAppartientAgent($this);
  111.         }
  112.         return $this;
  113.     }
  114.     public function removeEvenement(Evenement $evenement): self
  115.     {
  116.         if ($this->evenements->removeElement($evenement)) {
  117.             // set the owning side to null (unless already changed)
  118.             if ($evenement->getPlaceAppartientAgent() === $this) {
  119.                 $evenement->setPlaceAppartientAgent(null);
  120.             }
  121.         }
  122.         return $this;
  123.     }
  124.     /**
  125.      * @return Collection<int, Evenement>
  126.      */
  127.     public function getReservePar(): Collection
  128.     {
  129.         return $this->reservePar;
  130.     }
  131.     public function addReservePar(Evenement $reservePar): self
  132.     {
  133.         if (!$this->reservePar->contains($reservePar)) {
  134.             $this->reservePar[] = $reservePar;
  135.             $reservePar->setReserveParAgent($this);
  136.         }
  137.         return $this;
  138.     }
  139.     public function removeReservePar(Evenement $reservePar): self
  140.     {
  141.         if ($this->reservePar->removeElement($reservePar)) {
  142.             // set the owning side to null (unless already changed)
  143.             if ($reservePar->getReserveParAgent() === $this) {
  144.                 $reservePar->setReserveParAgent(null);
  145.             }
  146.         }
  147.         return $this;
  148.     }
  149.     /**
  150.      * @return Collection<int, Alerte>
  151.      */
  152.     public function getAlertes(): Collection
  153.     {
  154.         return $this->alertes;
  155.     }
  156.     public function addAlerte(Alerte $alerte): self
  157.     {
  158.         if (!$this->alertes->contains($alerte)) {
  159.             $this->alertes[] = $alerte;
  160.             $alerte->setUser($this);
  161.         }
  162.         return $this;
  163.     }
  164.     public function removeAlerte(Alerte $alerte): self
  165.     {
  166.         if ($this->alertes->removeElement($alerte)) {
  167.             // set the owning side to null (unless already changed)
  168.             if ($alerte->getUser() === $this) {
  169.                 $alerte->setUser(null);
  170.             }
  171.         }
  172.         return $this;
  173.     }
  174.     public function display(){
  175.         return $this->getNom().' '.substr($this->getPrenom(),0,1).'. ('.$this->place.')';
  176.     }
  177.     public function identite(){
  178.         return $this->getNom().' '.$this->getPrenom();
  179.     }
  180.     public function getMailPerso(): ?string
  181.     {
  182.         return $this->mail_perso;
  183.     }
  184.     public function setMailPerso(?string $mail_perso): self
  185.     {
  186.         $this->mail_perso $mail_perso;
  187.         return $this;
  188.     }
  189. }