<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* compte
* @UniqueEntity("email", message="This email is already in use.")
* @ORM\Table(name="compte")
* @ORM\Entity(repositoryClass="App\Repository\compteRepository")
*/
class compte implements UserInterface
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="keyiresa", type="string", length=255, nullable=true)
*/
private $keyiresa;
/**
* @var string
*
* @ORM\Column(name="civilite", type="smallint")
*/
private $civilite;
/**
* @var string
*
* @ORM\Column(name="nom", type="string", length=255)
*/
private $nom;
/**
* @var string
*
* @ORM\Column(name="prenom", type="string", length=255)
*/
private $prenom;
/**
* @var string
*
* @ORM\Column(name="email", type="string", length=255, unique=true)
*/
private $email;
/**
* @var string
*
* @ORM\Column(name="password", type="string", length=255)
*/
private $password;
/**
* @var string
*
* @ORM\Column(name="adresse", type="string", length=255)
*/
private $adresse;
/**
* @var string
*
* @ORM\Column(name="complementadresse", type="string", length=255, nullable=true)
*/
private $complementadresse;
/**
* @var string
*
* @ORM\Column(name="cp", type="string", length=255)
*/
private $cp;
/**
* @var string
*
* @ORM\Column(name="ville", type="string", length=255)
*/
private $ville;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\pays", cascade={"persist"})
* @ORM\JoinColumn(nullable=false)
*/
private $pays;
/**
* @var string
*
* @ORM\Column(name="tel", type="string", length=25)
*/
private $tel;
/**
* @var \DateTime
*
* @ORM\Column(name="datenaissance", type="datetime", nullable=true)
* @Assert\DateTime()
*/
private $datenaissance;
/**
* @var integer
*
* @ORM\Column(name="optin", type="smallint")
*/
private $optin;
/**
* @var \DateTime
*
* @ORM\Column(name="dateinscription", type="date", nullable=true)
*/
private $dateinscription;
/**
* @var integer
*
* @ORM\Column(name="etat", type="smallint")
*/
private $etat;
/**
* @var array
*
* @ORM\Column(name="roles", type="array", nullable=true)
*/
private $roles;
/**
* @var string
*
* @ORM\Column(name="reset_password_token", type="string", length=255, nullable=true)
*/
private $resetPasswordToken;
/**
* @ORM\ManyToOne(targetEntity=Language::class)
*/
private $lang;
public function __construct()
{
$this->etat = 1;
$this->dateinscription = new \DateTime('now');
$this->roles = array();
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set keyiresa
*
* @param string $keyiresa
* @return compte
*/
public function setKeyiresa($keyiresa)
{
$this->keyiresa = $keyiresa;
return $this;
}
/**
* Get keyiresa
*
* @return string
*/
public function getKeyiresa()
{
return $this->keyiresa;
}
/**
* Set civilite
*
* @param integer $civilite
* @return compte
*/
public function setCivilite($civilite)
{
$this->civilite = $civilite;
return $this;
}
/**
* Get civilite
*
* @return integer
*/
public function getCivilite()
{
return $this->civilite;
}
/**
* Set nom
*
* @param string $nom
* @return compte
*/
public function setNom($nom)
{
$this->nom = $nom;
return $this;
}
/**
* Get nom
*
* @return string
*/
public function getNom()
{
return $this->nom;
}
/**
* Set prenom
*
* @param string $prenom
* @return compte
*/
public function setPrenom($prenom)
{
$this->prenom = $prenom;
return $this;
}
/**
* Get prenom
*
* @return string
*/
public function getPrenom()
{
return $this->prenom;
}
/**
* Set email
*
* @param string $email
* @return compte
*/
public function setEmail($email)
{
$this->email = $email;
return $this;
}
/**
* Get email
*
* @return string
*/
public function getEmail()
{
return $this->email;
}
/**
* Set password
*
* @param string $password
* @return compte
*/
public function setPassword($password)
{
$this->password = $password;
return $this;
}
/**
* Get password
*
* @return string
*/
public function getPassword()
{
return $this->password;
}
/**
* Set adresse
*
* @param string $adresse
* @return compte
*/
public function setAdresse($adresse)
{
$this->adresse = $adresse;
return $this;
}
/**
* Get adresse
*
* @return string
*/
public function getAdresse()
{
return $this->adresse;
}
/**
* Set complementadresse
*
* @param string $complementadresse
* @return compte
*/
public function setComplementadresse($complementadresse)
{
$this->complementadresse = $complementadresse;
return $this;
}
/**
* Get complementadresse
*
* @return string
*/
public function getComplementadresse()
{
return $this->complementadresse;
}
/**
* Set cp
*
* @param string $cp
* @return compte
*/
public function setCp($cp)
{
$this->cp = $cp;
return $this;
}
/**
* Get cp
*
* @return string
*/
public function getCp()
{
return $this->cp;
}
/**
* Set ville
*
* @param string $ville
* @return compte
*/
public function setVille($ville)
{
$this->ville = $ville;
return $this;
}
/**
* Get ville
*
* @return string
*/
public function getVille()
{
return $this->ville;
}
/**
* Set pays
*
* @param string $pays
* @return compte
*/
public function setPays($pays)
{
$this->pays = $pays;
return $this;
}
/**
* Get pays
*
* @return string
*/
public function getPays()
{
return $this->pays;
}
/**
* Set tel
*
* @param string $tel
* @return compte
*/
public function setTel($tel)
{
$this->tel = $tel;
return $this;
}
/**
* Get tel
*
* @return string
*/
public function getTel()
{
return $this->tel;
}
/**
* Set datenaissance
*
* @param \DateTime $datenaissance
* @return compte
*/
public function setDatenaissance($datenaissance)
{
$this->datenaissance = $datenaissance;
return $this;
}
/**
* Get datenaissance
*
* @return \DateTime
*/
public function getDatenaissance()
{
return $this->datenaissance;
}
/**
* Set optin
*
* @param integer $optin
* @return compte
*/
public function setOptin($optin)
{
$this->optin = $optin;
return $this;
}
/**
* Get optin
*
* @return integer
*/
public function getOptin()
{
return $this->optin;
}
/**
* Set dateinscription
*
* @param \DateTime $dateinscription
*
* @return compte
*/
public function setDateinscription($dateinscription)
{
$this->dateinscription = $dateinscription;
return $this;
}
/**
* Get dateinscription
*
* @return \DateTime
*/
public function getDateinscription()
{
return $this->dateinscription;
}
/**
* Set etat
*
* @param integer $etat
* @return compte
*/
public function setEtat($etat)
{
$this->etat = $etat;
return $this;
}
/**
* Get etat
*
* @return integer
*/
public function getEtat()
{
return $this->etat;
}
public function getSalt()
{
}
/**
* Set roles
*
* @param array $roles
* @return User
*/
public function setRoles($roles)
{
$this->roles = $roles;
return $this;
}
/**
* Get roles
*
* @return array
*/
public function getRoles()
{
$roles = $this->roles;
$roles[] = 'ROLE_CUSTOMER';
return $roles;
}
public function eraseCredentials()
{
}
public function getUsername()
{
return $this->email;
}
/**
* Set resetPasswordToken
*
* @param string $resetPasswordToken
*
* @return compte
*/
public function setResetPasswordToken($resetPasswordToken)
{
$this->resetPasswordToken = $resetPasswordToken;
return $this;
}
/**
* Get resetPasswordToken
*
* @return string
*/
public function getResetPasswordToken()
{
return $this->resetPasswordToken;
}
public function __toString() {
return $this->getPrenom() . " " . $this->getNom();
}
public function getLang(): ?Language
{
return $this->lang;
}
public function setLang(?Language $lang): self
{
$this->lang = $lang;
return $this;
}
}