Quantcast
Channel: Active questions tagged symfony4 - Stack Overflow
Viewing all articles
Browse latest Browse all 3924

Symfony4 UserInterface missing ->getId() how to access users id

$
0
0

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?


Viewing all articles
Browse latest Browse all 3924

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>