I started a new project with Silex, it looks like a cool and fast Framework but I'm getting crazy with the SecurityServiceProvider trying to get the uid. I though it should be something like the getId() like Symfony but I got an error that the function doesn't exists.
PHP Fatal error: Call to undefined method Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage::getUser()
If I got the current logged user I have his information but not the Id.
$user = $app['user'];
print_r($user);
Symfony\Component\Security\Core\User\User Object ( [username:Symfony\Component\Security\Core\User\User:private] => [email protected] [password:Symfony\Component\Security\Core\User\User:private] => 5FZ2Z8QIkA7UTZ4BYkoC+GsReLf569mSKDsfods6LYQ8t+a8EW9oaircfMpmaLbPBh4FOBiiFyLfuZmTSUwzZg== [enabled:Symfony\Component\Security\Core\User\User:private] => 1 [accountNonExpired:Symfony\Component\Security\Core\User\User:private] => 1 [credentialsNonExpired:Symfony\Component\Security\Core\User\User:private] => 1 [accountNonLocked:Symfony\Component\Security\Core\User\User:private] => 1 [roles:Symfony\Component\Security\Core\User\User:private] => Array ( [0] => ROLE_USER ) )
Any idea? Thanks in advance!