After login, I want current user object in my class without creating service. Becauase I had already create current user pluggin and helper.
So If i need current user object in my class then How to get current user object.
i.e,
class CoreFunction
{
public static curentUserData()
{
// i want user object here
}
}
In Zend Framework 2, I just used:
class CoreFunction
{
public static curentUserData() {
$authService = $this->getServiceLocator()
->get('Zend\Authentication\AuthenticationService')
->getIdentity();
}
}
How can I do this in Zend Framework 3?