Reputation: 2082
I'm developing in admin side. And I needs to find user_id. The code
$this->user->getId()
provides no information. Is there any way to get user id. Thanks.
Upvotes: 0
Views: 580
Reputation: 2082
Here is the best way:
You cannot directly access user_id from database since it is protected.
So you have to access it from session.
$this->session->data['user_id'];
This returns the id of currently logged user.
Upvotes: 1