Source for file filters.php
Documentation is available at filters.php
* @package Joomla.Administrator
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
* Filters model class for Finder.
* @package Joomla.Administrator
* @param array $config An associative array of configuration settings. [optional]
if (empty($config['filter_fields']))
$config['filter_fields'] =
array(
'filter_id', 'a.filter_id',
'created_by_alias', 'a.created_by_alias',
'map_count', 'a.map_count'
* Build an SQL query to load the list data.
* @return JDatabaseQuery A JDatabaseQuery object
$query =
$db->getQuery(true);
// Select all fields from the table.
->from($db->quoteName('#__finder_filters') .
' AS a');
// Join over the users for the checked out user.
$query->select('uc.name AS editor')
->join('LEFT', $db->quoteName('#__users') .
' AS uc ON uc.id=a.checked_out');
// Join over the users for the author.
$query->select('ua.name AS user_name')
->join('LEFT', $db->quoteName('#__users') .
' AS ua ON ua.id = a.created_by');
// Check for a search filter.
$query->where('( a.title LIKE \'%' .
$db->escape($this->getState('filter.search')) .
'%\' )');
// If the model is set to check item state, add to the query.
$query->where('a.state = ' . (int)
$this->getState('filter.state'));
// Add the list ordering clause.
$query->order($db->escape($this->getState('list.ordering') .
' ' .
$db->escape($this->getState('list.direction'))));
* Method to get a store id based on model configuration state.
* This is necessary because the model is used by the component and
* different modules that might need different sets of data or different
* @param string $id A prefix for the store id. [optional]
* @return string A store id.
$id .=
':' .
$this->getState('filter.search');
$id .=
':' .
$this->getState('filter.state');
* Method to auto-populate the model state. Calling getState in this method will result in recursion.
* @param string $ordering An optional ordering field. [optional]
* @param string $direction An optional direction. [optional]
protected function populateState($ordering =
null, $direction =
null)
// Load the filter state.
$this->setState('filter.search', $search);
$this->setState('filter.state', $state);
// List state information.
Documentation generated on Tue, 19 Nov 2013 15:03:21 +0100 by phpDocumentor 1.4.3