mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-11 06:47:31 +01:00
75 lines
1.6 KiB
PHP
75 lines
1.6 KiB
PHP
<?php
|
|
namespace App\Entity;
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
use App\Entity\Attribut\UsernameAttribut;
|
|
use App\Entity\Attribut\PasswordAttribut;
|
|
|
|
/**
|
|
*
|
|
* @author kevinfrantz
|
|
* @ORM\Table(name="source_user")
|
|
* @ORM\Entity(repositoryClass="App\Repository\UserRepository")
|
|
*/
|
|
class User extends AbstractSource implements UserInterface
|
|
{
|
|
use UsernameAttribut,PasswordAttribut;
|
|
|
|
/**
|
|
* @ORM\Column(type="string", length=254, unique=true)
|
|
*/
|
|
private $email;
|
|
|
|
/**
|
|
* @ORM\Column(name="is_active", type="boolean")
|
|
*/
|
|
private $isActive;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->isActive = true;
|
|
// may not be needed, see section on salt below
|
|
// $this->salt = md5(uniqid('', true));
|
|
}
|
|
|
|
public function getSalt()
|
|
{
|
|
// you *may* need a real salt depending on your encoder
|
|
// see section on salt below
|
|
return null;
|
|
}
|
|
|
|
public function getRoles()
|
|
{
|
|
return array('ROLE_USER');
|
|
}
|
|
|
|
public function eraseCredentials()
|
|
{
|
|
}
|
|
|
|
/** @see \Serializable::serialize() */
|
|
public function serialize()
|
|
{
|
|
return serialize(array(
|
|
$this->id,
|
|
$this->username,
|
|
$this->password,
|
|
// see section on salt below
|
|
// $this->salt,
|
|
));
|
|
}
|
|
|
|
/** @see \Serializable::unserialize() */
|
|
public function unserialize($serialized)
|
|
{
|
|
list (
|
|
$this->id,
|
|
$this->username,
|
|
$this->password,
|
|
// see section on salt below
|
|
// $this->salt
|
|
) = unserialize($serialized, array('allowed_classes' => false));
|
|
}
|
|
}
|