english/administrator/components/com_installer/models/extension.php
/**
	 * Returns an object list
	 *
	 * @param	string The query
	 * @param	int Offset
	 * @param	int The number of records
	 * @return	array
	 */
Returns an object list
@param       string The query
@param       int Offset
@param       int The number of records
@return      array
Returns an object list @param string The query @param int Offset @param int The number of records @return array
protected function _getList($query, $limitstart = 0, $limit = 0)
	{
		$ordering	= $this->getState('list.ordering');
		$search		= $this->getState('filter.search');
		$search 	= str_replace('/', ' ', $search);
		$db			= $this->getDbo();
		if ($ordering == 'name' || (!empty($search) && stripos($search, 'id:') !== 0)) {
			$db->setQuery($query);
			$result = $db->loadObjectList();
			$lang = JFactory::getLanguage();
			$this->translate($result);
			if (!empty($search)) {
				foreach($result as $i=>$item) {
					if (!preg_match("/$search/i", $item->name)) {
						unset($result[$i]);
					}
				}
			}
			JArrayHelper::sortObjects($result, $this->getState('list.ordering'), $this->getState('list.direction') == 'desc' ? -1 : 1, true, $lang->getLocale());
			$total = count($result);
			$this->cache[$this->getStoreId('getTotal')] = $total;
			if ($total < $limitstart) {
				$limitstart = 0;
				$this->setState('list.start', 0);
			}
			return array_slice($result, $limitstart, $limit ? $limit : null);
		} else {
			$query->order($db->nameQuote($ordering) . ' ' . $this->getState('list.direction'));
			$result = parent::_getList($query, $limitstart, $limit);
			$this->translate($result);
			return $result;
		}
	}
protected function _getList ( $ query , $ limitstart = 0 , $ limit = 0 ) { $ ordering = $ this -> getState ( 'list.ordering' ) ; $ search = $ this -> getState ( 'filter.search' ) ; $ search = str_replace ( '/' , ' ' , $ search ) ; $ db = $ this -> getDbo ( ) ; if ( $ ordering == 'name' || ( ! empty ( $ search ) && stripos ( $ search , 'id:' ) !== 0 ) ) { $ db -> setQuery ( $ query ) ; $ result = $ db -> loadObjectList ( ) ; $ lang = JFactory :: getLanguage ( ) ; $ this -> translate ( $ result ) ; if ( ! empty ( $ search ) ) { foreach ( $ result as $ i => $ item ) { if ( ! preg_match ( " / $ search /i " , $ item -> name ) ) { unset ( $ result [ $ i ] ) ; } } } JArrayHelper :: sortObjects ( $ result , $ this -> getState ( 'list.ordering' ) , $ this -> getState ( 'list.direction' ) == 'desc' ? - 1 : 1 , true , $ lang -> getLocale ( ) ) ; $ total = count ( $ result ) ; $ this -> cache [ $ this -> getStoreId ( 'getTotal' ) ] = $ total ; if ( $ total < $ limitstart ) { $ limitstart = 0 ; $ this -> setState ( 'list.start' , 0 ) ; } return array_slice ( $ result , $ limitstart , $ limit ? $ limit : null ) ; } else { $ query -> order ( $ db -> nameQuote ( $ ordering ) . ' ' . $ this -> getState ( 'list.direction' ) ) ; $ result = parent :: _getList ( $ query , $ limitstart , $ limit ) ; $ this -> translate ( $ result ) ; return $ result ; } }
Returns an object list
 @param       string The query
 @param       int Offset
 @param       int The number of records
 @return      array
Returns an object list @param string The query @param int Offset @param int The number of records @return array
// Replace slashes so preg_match will work