public function ordered($orderBy = 'orderby', $orderDir = 'orderdir')
	{
		// Look for our request vars of interest
		$this->orderBy  = \Request::getCmd($orderBy, $this->getState('orderby', $this->orderBy));
		$this->orderDir = \Request::getCmd($orderDir, $this->getState('orderdir', $this->orderDir));

		$qualifiedOrderBy = $this->orderBy;

		// If we have a '.' we'll assume the prefix is a relationship name
		if (strpos($this->orderBy, '.') !== false)
		{
			list($relationship, $field) = explode('.', $this->orderBy);

			// We have to join to apply the order by clause
			$relationship     = $this->$relationship()->join();
			$qualifiedOrderBy = $relationship->getQualifiedFieldName($field);
		}

		// Apply order clause
		$this->order($qualifiedOrderBy, $this->orderDir);

		// Set state for future use
		$this->setState('orderby', $this->orderBy);
		$this->setState('orderdir', $this->orderDir);

		return $this;
	}
public function ordered($orderBy = 'orderby', $orderDir = 'orderdir')
	{
		// Look for our request vars of interest
		$this->orderBy  = \Request::getCmd($orderBy, $this->getState('orderby', $this->orderBy));
		$this->orderDir = \Request::getCmd($orderDir, $this->getState('orderdir', $this->orderDir));

		$qualifiedOrderBy = $this->orderBy;

		// If we have a '.' we'll assume the prefix is a relationship name
		if (strpos($this->orderBy, '.') !== false)
		{
			list($relationship, $field) = explode('.', $this->orderBy);

			// We have to join to apply the order by clause
			$relationship     = $this->$relationship()->join();
			$qualifiedOrderBy = $relationship->getQualifiedFieldName($field);
		}

		// Apply order clause
		$this->order($qualifiedOrderBy, $this->orderDir);

		// Set state for future use
		$this->setState('orderby', $this->orderBy);
		$this->setState('orderdir', $this->orderDir);

		return $this;
	}
public function ordered ( $ orderBy = 'orderby' , $ orderDir = 'orderdir' ) { // Look for our request vars of interest $ this -> orderBy = \ Request :: getCmd ( $ orderBy , $ this -> getState ( 'orderby' , $ this -> orderBy ) ) ; $ this -> orderDir = \ Request :: getCmd ( $ orderDir , $ this -> getState ( 'orderdir' , $ this -> orderDir ) ) ; $ qualifiedOrderBy = $ this -> orderBy ; // If we have a '.' we'll assume the prefix is a relationship name if ( strpos ( $ this -> orderBy , '.' ) !== false ) { list ( $ relationship , $ field ) = explode ( '.' , $ this -> orderBy ) ; // We have to join to apply the order by clause $ relationship = $ this -> $ relationship ( ) -> join ( ) ; $ qualifiedOrderBy = $ relationship -> getQualifiedFieldName ( $ field ) ; } // Apply order clause $ this -> order ( $ qualifiedOrderBy , $ this -> orderDir ) ; // Set state for future use $ this -> setState ( 'orderby' , $ this -> orderBy ) ; $ this -> setState ( 'orderdir' , $ this -> orderDir ) ; return $ this ; }
Sets the ordering based on the established request variables

@param   string  $orderBy   The request variable used to denote ordering column
@param   string  $orderDir  The request variable used to denote ordering direction
@return  $this
@since   2.0.0
Sets the ordering based on the established request variables