src/Entity/AppUser.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use FOS\UserBundle\Model\User as BaseUser;
  7. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  8. use Symfony\Component\HttpFoundation\File\File;
  9. use Symfony\Component\HttpFoundation\File\UploadedFile;
  10. use Symfony\Component\Validator\Constraints as Assert;
  11. /**
  12.  * Users
  13.  * @ORM\Entity
  14.  * @ORM\Table(name="app_user")
  15.  * @UniqueEntity("email")
  16.  */ 
  17. class AppUser extends BaseUser
  18. {
  19.     /**
  20.      * @ORM\ManyToOne(targetEntity="\App\Entity\Boutique")
  21.      */
  22.     private $boutique;
  23.     const ROLES = [
  24.         'ROLE_SUPER_ADMIN' => 'Super Administrateur',
  25.         'ROLE_ENTREPRISE' => 'Entreprise',
  26.         'ROLE_PARTICULIER' => 'Particulier',
  27.     ];
  28.     /**
  29.      * @var int
  30.      *
  31.      * @ORM\Column(name="id", type="integer", nullable=false)
  32.      * @ORM\Id
  33.      * @ORM\GeneratedValue(strategy="IDENTITY")
  34.      */
  35.     protected $id;
  36.     /*
  37.      * @var string
  38.      *
  39.      * @ORM\Column(name="nomprenoms", type="string", length=255, nullable=true)
  40.      * @Assert\NotBlank()
  41.      */
  42.     private $nomprenoms;
  43.     /**
  44.      * @var string
  45.      *
  46.      * @ORM\Column(name="nom", type="string", length=255, nullable=true)
  47.      */
  48.     private $nom;
  49.     /**
  50.      * @var string
  51.      *
  52.      * @ORM\Column(name="prenom", type="string", length=255, nullable=true)
  53.      */
  54.     private $prenom;
  55.     /**
  56.      * @var string
  57.      *
  58.      * @ORM\Column(name="nom_complet", type="string", length=255, nullable=true)
  59.      */
  60.     private $nomComplet;
  61.     /** 
  62.      * @var string
  63.      *
  64.      * @ORM\Column(name="dateNaissance", type="date", nullable=true)
  65.      */
  66.     private $dateNaissance;
  67.     /**
  68.      * @var string
  69.      *
  70.      * @ORM\Column(name="contacts", type="string", length=255, nullable=true)
  71.      */
  72.     private $contacts;
  73.     /**
  74.      * @var string|null
  75.      *
  76.      * @ORM\Column(name="adresse", type="string", length=255, nullable=true)
  77.      */
  78.     private $adresse;
  79.     /**
  80.      * @var string|null
  81.      *
  82.      * @ORM\Column(name="matricule", type="string", length=255, nullable=true)
  83.      */
  84.     private $matricule;
  85.     /**
  86.      * @var string|null
  87.      *
  88.      * @ORM\Column(name="salaire", type="float", nullable=true)
  89.      */
  90.     private $salaire;
  91.     /**
  92.      * @var string|null
  93.      *
  94.      * @ORM\Column(name="vacataire", type="boolean", nullable=true)
  95.      */
  96.     private $vacataire;
  97.     
  98.     /**
  99.      * @var \DateTime
  100.      *
  101.      * @ORM\Column(name="created_at", type="datetime", nullable=false)
  102.      */
  103.     private $createdAt;
  104.     /**
  105.      * @var \DateTime|null
  106.      *
  107.      * @ORM\Column(name="updated_at", type="datetime", nullable=true)
  108.      */
  109.     private $updatedAt;
  110.     /**
  111.      * @ORM\Column(type="string", length=255, nullable=true)
  112.      */
  113.     private $filename;
  114.     //Sync from main base piliersoft
  115.     public function __construct()
  116.     {
  117.         $this->roles = ['ROLE_USER'];
  118.         $this->createdAt = new \DateTime('now');
  119.     }
  120.     public function getId(): ?int
  121.     {
  122.         return $this->id;
  123.     }
  124.     public function getNomprenoms(): ?string
  125.     {
  126.         return $this->nomprenoms;
  127.     }
  128.     public function setNomprenoms(string $nomprenoms): self
  129.     {
  130.         $this->nomprenoms $nomprenoms;
  131.         return $this;
  132.     }
  133.     public function getContacts(): ?string
  134.     {
  135.         return $this->contacts;
  136.     }
  137.     public function setContacts(string $contacts): self
  138.     {
  139.         $this->contacts $contacts;
  140.         return $this;
  141.     }
  142.     public function getAdresse(): ?string
  143.     {
  144.         return $this->adresse;
  145.     }
  146.     public function setAdresse(?string $adresse): self
  147.     {
  148.         $this->adresse $adresse;
  149.         return $this;
  150.     }
  151.     public function getCreatedAt(): ?\DateTimeInterface
  152.     {
  153.         return $this->createdAt;
  154.     }
  155.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  156.     {
  157.         $this->createdAt $createdAt;
  158.         return $this;
  159.     }
  160.     public function getUpdatedAt(): ?\DateTimeInterface
  161.     {
  162.         return $this->updatedAt;
  163.     }
  164.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  165.     {
  166.         $this->updatedAt $updatedAt;
  167.         return $this;
  168.     }
  169.     /**
  170.      * @return string
  171.      */
  172.     public function getRole(): ?string
  173.     {
  174.         return $this->role;
  175.     }
  176.     public function setRole(string $role): self
  177.     {
  178.         $this->role $role;
  179.         return $this;
  180.     }
  181.     public function getRolesUsers(): string {
  182.         return self::ROLES[$this->role];
  183.     }
  184.     /**
  185.      * @return mixed
  186.      */
  187.     public function getEnabled()
  188.     {
  189.         return $this->enabled;
  190.     }
  191.     /**
  192.      * @param mixed $enabled
  193.      * @return Users
  194.      */
  195.     public function setEnabled($enabled)
  196.     {
  197.         $this->enabled $enabled;
  198.         return $this;
  199.     }
  200.     public function getFilename(): ?string
  201.     {
  202.         return $this->filename;
  203.     }
  204.     public function setFilename(?string $filename): self
  205.     {
  206.         $this->filename $filename;
  207.         return $this;
  208.     }
  209.     public function getBoutique(): ?Boutique
  210.     {
  211.         return $this->boutique;
  212.     }
  213.     public function setBoutique(?Boutique $boutique): self
  214.     {
  215.         $this->boutique $boutique;
  216.         return $this;
  217.     }
  218.     public function getNom(): ?string
  219.     {
  220.         return $this->nom;
  221.     }
  222.     public function setNom(?string $nom): self
  223.     {
  224.         $this->nom $nom;
  225.         return $this;
  226.     }
  227.     public function getPrenom(): ?string
  228.     {
  229.         return $this->prenom;
  230.     }
  231.     public function setPrenom(?string $prenom): self
  232.     {
  233.         $this->prenom $prenom;
  234.         return $this;
  235.     }
  236.     public function getNomComplet(): ?string
  237.     {
  238.         return $this->nomComplet;
  239.     }
  240.     public function setNomComplet(?string $nomComplet): self
  241.     {
  242.         $this->nomComplet $nomComplet;
  243.         return $this;
  244.     }
  245.     public function getDateNaissance(): ?\DateTimeInterface
  246.     {
  247.         return $this->dateNaissance;
  248.     }
  249.     public function setDateNaissance(?\DateTimeInterface $dateNaissance): self
  250.     {
  251.         $this->dateNaissance $dateNaissance;
  252.         return $this;
  253.     }
  254.     public function getSalaire(): ?float
  255.     {
  256.         return $this->salaire;
  257.     }
  258.     public function setSalaire(?float $salaire): self
  259.     {
  260.         $this->salaire $salaire;
  261.         return $this;
  262.     }
  263.     public function getVacataire(): ?bool
  264.     {
  265.         return $this->vacataire;
  266.     }
  267.     public function setVacataire(?bool $vacataire): self
  268.     {
  269.         $this->vacataire $vacataire;
  270.         return $this;
  271.     }
  272.     public function getMatricule(): ?string
  273.     {
  274.         return $this->matricule;
  275.     }
  276.     public function setMatricule(?string $matricule): self
  277.     {
  278.         $this->matricule $matricule;
  279.         return $this;
  280.     }
  281. }