Cake\Controller\Component\AuthComponent::_getUser PHP Метод

_getUser() защищенный Метод

This lets stateless authentication methods function correctly.
protected _getUser ( ) : boolean
Результат boolean true If a user can be found, false if one cannot.
    protected function _getUser()
    {
        $user = $this->user();
        if ($user) {
            $this->storage()->redirectUrl(false);
            return true;
        }
        if (empty($this->_authenticateObjects)) {
            $this->constructAuthenticate();
        }
        foreach ($this->_authenticateObjects as $auth) {
            $result = $auth->getUser($this->request);
            if (!empty($result) && is_array($result)) {
                $this->_authenticationProvider = $auth;
                $event = $this->dispatchEvent('Auth.afterIdentify', [$result, $auth]);
                if ($event->result !== null) {
                    $result = $event->result;
                }
                $this->storage()->write($result);
                return true;
            }
        }
        return false;
    }