Why is there no getId()
method inside the UserInterface
in Symfony 4? I tried to pass UserInterface $user
to my Controller method to actually access the current logged in user's id with $user->getId()
.
But this method simply doesn't exist inside this interface - talking about best practice I should not simply add this method to the interface, right?
I also tried to use my entity but was not able to access the current user object to fetch the id of the object.
First time sf4, am I getting it totally wrong?