infinito/application/src/Entity/User.php

63 lines
1.3 KiB
PHP
Raw Normal View History

2018-09-05 15:46:14 +02:00
<?php
namespace App\Entity;
2018-09-06 14:03:08 +02:00
use Doctrine\ORM\Mapping as ORM;
2018-09-06 15:14:33 +02:00
use App\Entity\Attribut\UsernameAttribut;
use App\Entity\Attribut\PasswordAttribut;
2018-09-12 19:57:40 +02:00
use App\Entity\Attribut\PlainPasswordAttribute;
2018-09-06 15:14:33 +02:00
2018-09-05 15:46:14 +02:00
/**
*
* @author kevinfrantz
2018-09-06 11:57:32 +02:00
* @ORM\Table(name="source_user")
* @ORM\Entity(repositoryClass="App\Repository\UserRepository")
2018-09-05 15:46:14 +02:00
*/
2018-09-06 15:14:33 +02:00
class User extends AbstractSource implements UserInterface
2018-09-05 15:46:14 +02:00
{
2018-09-12 19:57:40 +02:00
use UsernameAttribut,PasswordAttribut,PlainPasswordAttribute;
2018-09-06 15:14:33 +02:00
2018-09-06 11:57:32 +02:00
/**
* @ORM\Column(name="is_active", type="boolean")
*/
private $isActive;
public function __construct()
{
$this->isActive = true;
}
public function getSalt()
{
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 \Serializable::unserialize() */
public function unserialize($serialized)
{
list (
$this->id,
$this->username,
$this->password,
) = unserialize($serialized, array('allowed_classes' => false));
}
}