public function get($key, $default = null)
	{
		if ($key == 'guest')
		{
			return $this->isGuest();
		}

		if ($key == 'uidNumber')
		{
			$key = 'id';
		}

		// If the givenName, middleName, or surname isn't set, try to determine it from the name
		if (($key == 'givenName' || $key == 'middleName' || $key == 'surname') && parent::get($key, null) == null)
		{
			return $this->parseName($key);
		}

		// Legacy code expects get('id') to always
		// return an integer, even if user is logged out
		if ($key == 'id' && is_null($default))
		{
			$default = 0;
		}

		return parent::get($key, $default);
	}
public function get($key, $default = null)
	{
		if ($key == 'guest')
		{
			return $this->isGuest();
		}

		if ($key == 'uidNumber')
		{
			$key = 'id';
		}

		// If the givenName, middleName, or surname isn't set, try to determine it from the name
		if (($key == 'givenName' || $key == 'middleName' || $key == 'surname') && parent::get($key, null) == null)
		{
			return $this->parseName($key);
		}

		// Legacy code expects get('id') to always
		// return an integer, even if user is logged out
		if ($key == 'id' && is_null($default))
		{
			$default = 0;
		}

		return parent::get($key, $default);
	}
public function get ( $ key , $ default = null ) { if ( $ key == 'guest' ) { return $ this -> isGuest ( ) ; } if ( $ key == 'uidNumber' ) { $ key = 'id' ; } // If the givenName, middleName, or surname isn't set, try to determine it from the name if ( ( $ key == 'givenName' || $ key == 'middleName' || $ key == 'surname' ) && parent :: get ( $ key , null ) == null ) { return $ this -> parseName ( $ key ) ; } // Legacy code expects get('id') to always // return an integer, even if user is logged out if ( $ key == 'id' && is_null ( $ default ) ) { $ default = 0 ; } return parent :: get ( $ key , $ default ) ; }
Gets an attribute by key

This will not retrieve properties directly attached to the model,
even if they are public - those should be accessed directly!

Also, make sure to access properties in transformers using the get method.
Otherwise you'll just get stuck in a loop!

@param   string  $key      The attribute key to get
@param   mixed   $default  The value to provide, should the key be non-existent
@return  mixed
Gets an attribute by key