code/user/provider/abstract.php
public function getUser($identifier)
    {
        //Fetch a user from the backend if not loaded yet
        if(!$this->isLoaded($identifier)) {
            $this->fetch($identifier);
        }

        //Create an anonymous user was not loaded
        if(!$user = $this->findUser($identifier))
        {
            $user  = $this->create(array(
                'id'   => 0,
                'name' => $this->getObject('translator')->translate('Anonymous')
            ));
        }

        return $user;
    }
public function getUser($identifier)
    {
        //Fetch a user from the backend if not loaded yet
        if(!$this->isLoaded($identifier)) {
            $this->fetch($identifier);
        }

        //Create an anonymous user was not loaded
        if(!$user = $this->findUser($identifier))
        {
            $user  = $this->create(array(
                'id'   => 0,
                'name' => $this->getObject('translator')->translate('Anonymous')
            ));
        }

        return $user;
    }
public function getUser ( $ identifier ) { //Fetch a user from the backend if not loaded yet if ( ! $ this -> isLoaded ( $ identifier ) ) { $ this -> fetch ( $ identifier ) ; } //Create an anonymous user was not loaded if ( ! $ user = $ this -> findUser ( $ identifier ) ) { $ user = $ this -> create ( array ( 'id' => 0 , 'name' => $ this -> getObject ( 'translator' ) -> translate ( 'Anonymous' ) ) ) ; } return $ user ; }
Load the user for the given username or identifier

If the user could not be loaded an anonymous user will be returned with a user 'id' off 0.

@param string $identifier A unique user identifier, (i.e a username or email address)
@return UserInterface Returns a UserInterface object.
Load the user for the given username or identifier