Retrieve default identity

@return \ArrayAccess|null
439943
public function getDefaultIdentity()
	{
	    if (!$this->defaultIdentity) {
	        $this->defaultIdentity = new ArrayObject(array());

	        if ($this->exists('Identity')) {
	            $responses = $this->execute(
                    'Identity',
                    'getIdentity',
                    array(),
                    function($response){if($response instanceof ArrayAccess) return true;});

	            if (sizeof($responses)) {
	                $this->defaultIdentity = $responses->last();
	            }

	            if ($this->defaultIdentity instanceof \ArrayObject) {
	                $this->defaultIdentity->setFlags(\ArrayObject::ARRAY_AS_PROPS);
	            } elseif(!$this->defaultIdentity) {
	                return new \ArrayObject([]);
	            }
	        }

	    }

	    return $this->defaultIdentity;
	}
709011
public function offsetGet($offset)
    {
        if (isset($this->identity[$offset])) {
            return $this->identity[$offset];
        }

        return null;
    }
171014
public function getIdentifier()
    {
        $identifierAttribute = $this->getFamily()->getAttributeAsIdentifier();
        if ($identifierAttribute) {
            /** @noinspection ExceptionsAnnotatingAndHandlingInspection */

            return $this->get($identifierAttribute->getCode());
        }

        return $this->getId();
    }
348558
public function getDefault($name)
    {
        return isset($this->defaults[$name]) ? $this->defaults[$name] : null;
    }
306955
public function authenticate()
    {
        $u = $this->authenticateBySession();
        if ($u) {
            return $u;
        }

        $u = $this->authenticateByToken();
        if ($u) {
            return $u;
        }

        return null;
    }
1130209
public function get()
    {
        $identities = [];
        $origData   = $this->optimizer->getOrigData();
        $containers = $this->optimizer->getData('search_container') ?? [];

        if (!$this->optimizer->isObjectNew()) {
            $containers = array_unique(
                array_keys(array_merge($this->optimizer->getSearchContainers(), $origData['search_containers'] ?? []))
            );
        }

        if (in_array('quick_search_container', $containers)) {
            $identities = array_merge($identities, $this->getSearchQueryIdentities());
        }

        if (in_array('catalog_view_container', $containers)) {
            $identities = array_merge($identities, $this->getCategoryIdentities());
        }

        return $identities;
    }
995352
public function getUserData()
    {
        if (!$this->tokenStorage->getToken()
            || !$this->authorizationChecker->isGranted('IS_AUTHENTICATED_REMEMBERED')
        ) {
            return null;
        }

        $user = $this->tokenStorage->getToken()->getUser();

        if (!$user) {
            return null;
        }

        return $this->userHelper->buildUserData($user);
    }
760767
public function clientId()
	{
		if (isset($this->client_id)) {
			return $this->client_id ? $this->client_id : null;
		}
		
		if (!$this->check()) {
			return null;
		}
		
		if (Request::input('client_id')) {
			$this->client_id = Request::input('client_id');
		}
		else if ($id = Authorizer::getClientId()) {
			$this->client_id = $id;
		}
		else {
			$this->client_id = false;
		}
		
		return $this->client_id ? $this->client_id : null;
	}
1299224
function getIdentity()
        {
        
            if( $this->container->get('session')->has('identity'))
            {
           
                $obj = unserialize( $this->container->get('session')->get('identity'));
                return $obj;
            }
            else
            {
                return null;
            }
   
        }
915831
public function getDefaultAction()
    {
        // Determine the appliccable action
        if ( ! $this->default_action) {
            return null;
        }

        $actions = $this->default_action;

        if ( ! is_array($actions)) {
            $actions = [
                new ModelActionReferenceData([
                    'strategy' => $actions,
                ]),
            ];
        }

        $core = $this->getCore();


        foreach ($actions as $action) {

            $permissions = $action->permissions();

            if (    ! count($permissions)
                ||  $core->auth()->user()->isAdmin()
                ||  $core->auth()->user()->can($permissions)
            ) {
                return $action;
            }
        }

        return null;
    }
73089
public function getId($default = null)
    {
        $context = $this->_context;

        if (!$context->claims) {
            if ($default === null) {
                throw new AuthenticationException('Not Authenticated');
            } else {
                return $default;
            }
        } elseif (!$context->type) {
            return $default;
        } else {
            $id = $context->type . '_id';
            return isset($context->claims[$id]) ? $context->claims[$id] : 0;
        }
    }
713635
protected function getUsername()
    {

        // initialize the name
        $name = null;

        // query whether or not we've an principal
        if ($identity = $this->getIdentity()) {
            $name = $identity->getName();
        }

        // return the name
        return $name;
    }
812634
protected function getUserId() {
        $user = Auth::user();
        if (is_object($user) && !empty($user->id)) {
            return $user->id;
        } else {
            return null;
        }
    }
1295229
public function getDefaultIdentifier()
    {
        if ($defaultIdentifiers = $this->config()->default_identifiers) {
            
            if (isset($defaultIdentifiers[$this->getClass()])) {
                return $defaultIdentifiers[$this->getClass()];
            }
            
        }
    }
85853
public function getDefault()
    {
        if ($this->reflection->isDefaultValueAvailable()
            and $default = $this->reflection->getDefaultValue()
        ) {
            if (is_scalar($default)) {
                return $default;
            } else {
                return $this->tostring($default);
            }
        }
        if ($this->reflection->isArray()) {
            return '[]';
        }
        if ($this->isPassedByReference()) {
            return 'null';
        } elseif ($this->reflection->getClass()) {
            // This gets injected as a new instance.
            return null;
        }
        $type = $this->getType();
        if (!$type) {
            $type = $this->extractParameterData();
        }
        // Guesstimated values:
        switch ($type) {
            case 'int': case 'integer': case 'float':
                return 0;
            case 'string':
                return "''";
            case 'array':
                return '[]';
        }
        return null;
    }
1161457
public static function moduleUserIdentity()
    {
        if (empty(static::$_moduleUserIdentity)) {
            $module = Yii::$app->getModule(static::parameter('userModuleUniqueId'));
            if (!empty($module) && $module instanceof UniModule) {
                $result = $module->getDataModel(static::parameter('userManagerAlias'));
                static::$_moduleUserIdentity = $result;
            }
        }

        //return null; // use for debug
        return static::$_moduleUserIdentity;
    }
15864
public function getUserId()
    {
        if (
            \Yii::$app !== null
            && \Yii::$app->has('user', true)
            && \Yii::$app->getUser() !== null
        ) {
            $user = \Yii::$app->getUser()->getIdentity(false);
            if ($user !== null) {
                return $user->getId();
            }
        }
        return null;
    }