<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use FOS\UserBundle\Model\User as BaseUser;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Users
* @ORM\Entity
* @ORM\Table(name="app_user")
* @UniqueEntity("email")
*/
class AppUser extends BaseUser
{
/**
* @ORM\ManyToOne(targetEntity="\App\Entity\Boutique")
*/
private $boutique;
const ROLES = [
'ROLE_SUPER_ADMIN' => 'Super Administrateur',
'ROLE_ENTREPRISE' => 'Entreprise',
'ROLE_PARTICULIER' => 'Particulier',
];
/**
* @var int
*
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
protected $id;
/*
* @var string
*
* @ORM\Column(name="nomprenoms", type="string", length=255, nullable=true)
* @Assert\NotBlank()
*/
private $nomprenoms;
/**
* @var string
*
* @ORM\Column(name="nom", type="string", length=255, nullable=true)
*/
private $nom;
/**
* @var string
*
* @ORM\Column(name="prenom", type="string", length=255, nullable=true)
*/
private $prenom;
/**
* @var string
*
* @ORM\Column(name="nom_complet", type="string", length=255, nullable=true)
*/
private $nomComplet;
/**
* @var string
*
* @ORM\Column(name="dateNaissance", type="date", nullable=true)
*/
private $dateNaissance;
/**
* @var string
*
* @ORM\Column(name="contacts", type="string", length=255, nullable=true)
*/
private $contacts;
/**
* @var string|null
*
* @ORM\Column(name="adresse", type="string", length=255, nullable=true)
*/
private $adresse;
/**
* @var string|null
*
* @ORM\Column(name="matricule", type="string", length=255, nullable=true)
*/
private $matricule;
/**
* @var string|null
*
* @ORM\Column(name="salaire", type="float", nullable=true)
*/
private $salaire;
/**
* @var string|null
*
* @ORM\Column(name="vacataire", type="boolean", nullable=true)
*/
private $vacataire;
/**
* @var \DateTime
*
* @ORM\Column(name="created_at", type="datetime", nullable=false)
*/
private $createdAt;
/**
* @var \DateTime|null
*
* @ORM\Column(name="updated_at", type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $filename;
//Sync from main base piliersoft
public function __construct()
{
$this->roles = ['ROLE_USER'];
$this->createdAt = new \DateTime('now');
}
public function getId(): ?int
{
return $this->id;
}
public function getNomprenoms(): ?string
{
return $this->nomprenoms;
}
public function setNomprenoms(string $nomprenoms): self
{
$this->nomprenoms = $nomprenoms;
return $this;
}
public function getContacts(): ?string
{
return $this->contacts;
}
public function setContacts(string $contacts): self
{
$this->contacts = $contacts;
return $this;
}
public function getAdresse(): ?string
{
return $this->adresse;
}
public function setAdresse(?string $adresse): self
{
$this->adresse = $adresse;
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;
}
/**
* @return string
*/
public function getRole(): ?string
{
return $this->role;
}
public function setRole(string $role): self
{
$this->role = $role;
return $this;
}
public function getRolesUsers(): string {
return self::ROLES[$this->role];
}
/**
* @return mixed
*/
public function getEnabled()
{
return $this->enabled;
}
/**
* @param mixed $enabled
* @return Users
*/
public function setEnabled($enabled)
{
$this->enabled = $enabled;
return $this;
}
public function getFilename(): ?string
{
return $this->filename;
}
public function setFilename(?string $filename): self
{
$this->filename = $filename;
return $this;
}
public function getBoutique(): ?Boutique
{
return $this->boutique;
}
public function setBoutique(?Boutique $boutique): self
{
$this->boutique = $boutique;
return $this;
}
public function getNom(): ?string
{
return $this->nom;
}
public function setNom(?string $nom): self
{
$this->nom = $nom;
return $this;
}
public function getPrenom(): ?string
{
return $this->prenom;
}
public function setPrenom(?string $prenom): self
{
$this->prenom = $prenom;
return $this;
}
public function getNomComplet(): ?string
{
return $this->nomComplet;
}
public function setNomComplet(?string $nomComplet): self
{
$this->nomComplet = $nomComplet;
return $this;
}
public function getDateNaissance(): ?\DateTimeInterface
{
return $this->dateNaissance;
}
public function setDateNaissance(?\DateTimeInterface $dateNaissance): self
{
$this->dateNaissance = $dateNaissance;
return $this;
}
public function getSalaire(): ?float
{
return $this->salaire;
}
public function setSalaire(?float $salaire): self
{
$this->salaire = $salaire;
return $this;
}
public function getVacataire(): ?bool
{
return $this->vacataire;
}
public function setVacataire(?bool $vacataire): self
{
$this->vacataire = $vacataire;
return $this;
}
public function getMatricule(): ?string
{
return $this->matricule;
}
public function setMatricule(?string $matricule): self
{
$this->matricule = $matricule;
return $this;
}
}