public function getActiveRecordObjects($class, $orderBy=NULL, $descOrder=FALSE) {

		if (!class_exists($class) or !is_subclass_of($class, 'Pair\ActiveRecord')) {
			return array();
		}
		
		// sets pagination count
		$this->db->setQuery('SELECT COUNT(*) FROM `' . $class::TABLE_NAME . '`');
		$this->pagination->count = $this->db->loadCount();
	
		$orderDir = $descOrder ? 'DESC' : 'ASC';
		
		$query =
			'SELECT *' .
			' FROM `' . $class::TABLE_NAME . '`' .
			($orderBy ? ' ORDER BY `' . $orderBy . '` ' . $orderDir : NULL) .
			' LIMIT ' . $this->pagination->start . ', ' . $this->pagination->limit;
	
		$this->db->setQuery($query);
		$list = $this->db->loadObjectList();
	
		$objects = array();
	
		foreach ($list as $item) {
			$objects[] = new $class($item);
		}

		return $objects;
	
	}
public function getActiveRecordObjects($class, $orderBy=NULL, $descOrder=FALSE) {

		if (!class_exists($class) or !is_subclass_of($class, 'Pair\ActiveRecord')) {
			return array();
		}
		
		// sets pagination count
		$this->db->setQuery('SELECT COUNT(*) FROM `' . $class::TABLE_NAME . '`');
		$this->pagination->count = $this->db->loadCount();
	
		$orderDir = $descOrder ? 'DESC' : 'ASC';
		
		$query =
			'SELECT *' .
			' FROM `' . $class::TABLE_NAME . '`' .
			($orderBy ? ' ORDER BY `' . $orderBy . '` ' . $orderDir : NULL) .
			' LIMIT ' . $this->pagination->start . ', ' . $this->pagination->limit;
	
		$this->db->setQuery($query);
		$list = $this->db->loadObjectList();
	
		$objects = array();
	
		foreach ($list as $item) {
			$objects[] = new $class($item);
		}

		return $objects;
	
	}
public function getActiveRecordObjects ( $ class , $ orderBy = NULL , $ descOrder = FALSE ) { if ( ! class_exists ( $ class ) or ! is_subclass_of ( $ class , 'Pair\ActiveRecord' ) ) { return array ( ) ; } // sets pagination count $ this -> db -> setQuery ( 'SELECT COUNT(*) FROM `' . $ class :: TABLE_NAME . '`' ) ; $ this -> pagination -> count = $ this -> db -> loadCount ( ) ; $ orderDir = $ descOrder ? 'DESC' : 'ASC' ; $ query = 'SELECT *' . ' FROM `' . $ class :: TABLE_NAME . '`' . ( $ orderBy ? ' ORDER BY `' . $ orderBy . '` ' . $ orderDir : NULL ) . ' LIMIT ' . $ this -> pagination -> start . ', ' . $ this -> pagination -> limit ; $ this -> db -> setQuery ( $ query ) ; $ list = $ this -> db -> loadObjectList ( ) ; $ objects = array ( ) ; foreach ( $ list as $ item ) { $ objects [ ] = new $ class ( $ item ) ; } return $ objects ; }
Returns list of all object specified in param, within pagination limit and sets
pagination count.

@param	string	Name of desired class.
@param	string	Ordering db field.
@param	bool	Sorting direction ASC or DESC (optional)

@return	array:multitype
Returns list of all object specified in param within pagination limit and sets pagination count .