private function _mysql_load($user)
	{
		$db = \App::get('db');

		if (empty($user))
		{
			$this->setError('No user specified');
			return false;
		}

		// zooley: Removed check for >= 0 because profiles without acounts have negative IDs
		//if (is_numeric($user) && $user >= 0)
		if (is_numeric($user))
		{
			$query = "SELECT * FROM `#__xprofiles` WHERE uidNumber = " . $db->quote(intval($user)) . ";";
		}
		else
		{
			$query = "SELECT * FROM `#__xprofiles` WHERE username = " . $db->quote($user) . " AND uidNumber>0;";
		}

		$db->setQuery($query);

		$result = $db->loadAssoc();

		if ($result === false)
		{
			$this->setError('Error retrieving data from xprofiles table: ' . $db->getErrorMsg());
			return false;
		}

		if (empty($result))
		{
			$this->setError('No such user [' . $user . ']');
			return false;
		}

		$this->clear();

		$this->_params = new Registry($result['params']);

		foreach ($result as $property => $value)
		{
			$this->set($property, $value);
		}

		$classvars = get_class_vars(__CLASS__);

		foreach ($classvars as $property => $value)
		{
			if ('_auxv_' == substr($property, 0, 6) || '_auxs_' == substr($property, 0, 6))
			{
				$this->$property = false; // This property is loaded on demand
			}
		}

		$this->_params->merge($this->params);

		return true;
	}
private function _mysql_load($user)
	{
		$db = \App::get('db');

		if (empty($user))
		{
			$this->setError('No user specified');
			return false;
		}

		// zooley: Removed check for >= 0 because profiles without acounts have negative IDs
		//if (is_numeric($user) && $user >= 0)
		if (is_numeric($user))
		{
			$query = "SELECT * FROM `#__xprofiles` WHERE uidNumber = " . $db->quote(intval($user)) . ";";
		}
		else
		{
			$query = "SELECT * FROM `#__xprofiles` WHERE username = " . $db->quote($user) . " AND uidNumber>0;";
		}

		$db->setQuery($query);

		$result = $db->loadAssoc();

		if ($result === false)
		{
			$this->setError('Error retrieving data from xprofiles table: ' . $db->getErrorMsg());
			return false;
		}

		if (empty($result))
		{
			$this->setError('No such user [' . $user . ']');
			return false;
		}

		$this->clear();

		$this->_params = new Registry($result['params']);

		foreach ($result as $property => $value)
		{
			$this->set($property, $value);
		}

		$classvars = get_class_vars(__CLASS__);

		foreach ($classvars as $property => $value)
		{
			if ('_auxv_' == substr($property, 0, 6) || '_auxs_' == substr($property, 0, 6))
			{
				$this->$property = false; // This property is loaded on demand
			}
		}

		$this->_params->merge($this->params);

		return true;
	}
private function _mysql_load ( $ user ) { $ db = \ App :: get ( 'db' ) ; if ( empty ( $ user ) ) { $ this -> setError ( 'No user specified' ) ; return false ; } // zooley: Removed check for >= 0 because profiles without acounts have negative IDs //if (is_numeric($user) && $user >= 0) if ( is_numeric ( $ user ) ) { $ query = "SELECT * FROM `#__xprofiles` WHERE uidNumber = " . $ db -> quote ( intval ( $ user ) ) . ";" ; } else { $ query = "SELECT * FROM `#__xprofiles` WHERE username = " . $ db -> quote ( $ user ) . " AND uidNumber>0;" ; } $ db -> setQuery ( $ query ) ; $ result = $ db -> loadAssoc ( ) ; if ( $ result === false ) { $ this -> setError ( 'Error retrieving data from xprofiles table: ' . $ db -> getErrorMsg ( ) ) ; return false ; } if ( empty ( $ result ) ) { $ this -> setError ( 'No such user [' . $ user . ']' ) ; return false ; } $ this -> clear ( ) ; $ this -> _params = new Registry ( $ result [ 'params' ] ) ; foreach ( $ result as $ property => $ value ) { $ this -> set ( $ property , $ value ) ; } $ classvars = get_class_vars ( __CLASS__ ) ; foreach ( $ classvars as $ property => $ value ) { if ( '_auxv_' == substr ( $ property , 0 , 6 ) || '_auxs_' == substr ( $ property , 0 , 6 ) ) { $ this -> $ property = false ; // This property is loaded on demand } } $ this -> _params -> merge ( $ this -> params ) ; return true ; }
Load a record from the MySQL database

@param   mixed    $user  Integer (ID) or string (username)
@return  boolean  True on success, False on error
Load a record from the MySQL database