framework/web/CSort.php
public function resolveAttribute($attribute)
	{
		if($this->attributes!==array())
			$attributes=$this->attributes;
		elseif($this->modelClass!==null)
			$attributes=$this->getModel($this->modelClass)->attributeNames();
		else
			return false;
		foreach($attributes as $name=>$definition)
		{
			if(is_string($name))
			{
				if($name===$attribute)
					return $definition;
			}
			elseif($definition==='*')
			{
				if($this->modelClass!==null && $this->getModel($this->modelClass)->hasAttribute($attribute))
					return $attribute;
			}
			elseif($definition===$attribute)
				return $attribute;
		}
		return false;
	}
public function resolveAttribute($attribute)
	{
		if($this->attributes!==array())
			$attributes=$this->attributes;
		elseif($this->modelClass!==null)
			$attributes=$this->getModel($this->modelClass)->attributeNames();
		else
			return false;
		foreach($attributes as $name=>$definition)
		{
			if(is_string($name))
			{
				if($name===$attribute)
					return $definition;
			}
			elseif($definition==='*')
			{
				if($this->modelClass!==null && $this->getModel($this->modelClass)->hasAttribute($attribute))
					return $attribute;
			}
			elseif($definition===$attribute)
				return $attribute;
		}
		return false;
	}
public function resolveAttribute ( $ attribute ) { if ( $ this -> attributes !== array ( ) ) $ attributes = $ this -> attributes ; elseif ( $ this -> modelClass !== null ) $ attributes = $ this -> getModel ( $ this -> modelClass ) -> attributeNames ( ) ; else return false ; foreach ( $ attributes as $ name => $ definition ) { if ( is_string ( $ name ) ) { if ( $ name === $ attribute ) return $ definition ; } elseif ( $ definition === '*' ) { if ( $ this -> modelClass !== null && $ this -> getModel ( $ this -> modelClass ) -> hasAttribute ( $ attribute ) ) return $ attribute ; } elseif ( $ definition === $ attribute ) return $ attribute ; } return false ; }
Returns the real definition of an attribute given its name.

The resolution is based on {@link attributes} and {@link CActiveRecord::attributeNames}.
<ul>
<li>When {@link attributes} is an empty array, if the name refers to an attribute of {@link modelClass},
then the name is returned back.</li>
<li>When {@link attributes} is not empty, if the name refers to an attribute declared in {@link attributes},
then the corresponding virtual attribute definition is returned. Starting from version 1.1.3, if {@link attributes}
contains a star ('*') element, the name will also be used to match against all model attributes.</li>
<li>In all other cases, false is returned, meaning the name does not refer to a valid attribute.</li>
</ul>
@param string $attribute the attribute name that the user requests to sort on
@return mixed the attribute name or the virtual attribute definition. False if the attribute cannot be sorted.
Returns the real definition of an attribute given its name .