for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* File part of the Redmine User Provider bundle
*
* @category SymfonyBundle
* @package GMaissa.RedmineUserProviderBundle
* @author Guillaume Maïssa <[email protected]>
* @copyright 2017 Guillaume Maïssa
* @license https://opensource.org/licenses/MIT The MIT License (MIT)
*/
namespace GMaissa\RedmineUserProviderBundle\Model;
use Symfony\Component\Security\Core\User\UserInterface;
* User Model Class
class RedmineUser implements UserInterface
{
const ROLE_DEFAULT = 'ROLE_USER';
* @var integer
protected $id;
* @var string
protected $firstname;
protected $lastname;
protected $email;
protected $username;
protected $password;
* @var array
protected $roles;
* @var bool
protected $enabled;
protected $salt;
* User constructor
* @param array $properties
public function __construct($properties = array())
$this->roles = [];
foreach ($properties as $key => $value) {
$this->$key = $value;
}
* {@inheritdoc}
public function getRoles()
$roles = $this->roles;
if (count($roles) == 0) {
$roles[] = self::ROLE_DEFAULT;
return $roles;
public function getSalt()
return $this->salt;
public function getPassword()
return $this->password;
public function getUsername()
return $this->username;
public function eraseCredentials()
$this->password = null;