I can't answer your first question, but regarding your second question:
The getAuthService()
method in your code returns an AuthenticationService
object, which has a hasIdentity()
method.
So there are two different hasIdentity()
methods:
- In the
AuthenticationService
class (source code here). - In the
ZfcUserAuthentication
class which you're looking at.
This line of code in the ZfcUserAuthentication
class:
return $this->getAuthService()->hasIdentity();
does three things:
$this->getAuthService()
returns anAuthenticationService
object.- The
hasIdentity()
method of thatAuthenticationService
object is then called, and it returns aboolean
. - That
boolean
is then returned.
Imagine splitting the code into two parts:
// Get AuthenticationService object Call a method of that object
$this->getAuthService() ->hasIdentity();
Hope that helps!