Reputation: 7800
Why the entity provider in it's refreshUser
method returns a user
object having NULL
as username instead of the actual username ?
public function refreshUser(UserInterface $user)
{
$class = get_class($user);
if (!$this->supportsClass($class)) {
throw new UnsupportedUserException(
sprintf(
'Instances of "%s" are not supported.',
$class
)
);
}
var_dump($user->getUsername()); // prints NULL
die();
return $this->loadUserByUsername($user->getUsername());
}
Upvotes: 0
Views: 98
Reputation: 306
It seems that only the id attribute is public. However the username attribute is may be private. And for that, the serialization of the object user makes the username = null.
Upvotes: 1