Skip to content

Commit

Permalink
Rename JModel _populateState to populateState, _getStoreId to getStor…
Browse files Browse the repository at this point in the history
…eId, _getListQuery to getListQuery.

git-svn-id: http://joomlacode.org/svn/joomla/development/trunk@16239 6f6e1ebd-4c2b-0410-823f-f34bde69bce9
  • Loading branch information
eddieajau committed Apr 20, 2010
1 parent 48010f6 commit 0bdbbfe
Show file tree
Hide file tree
Showing 83 changed files with 213 additions and 210 deletions.
2 changes: 1 addition & 1 deletion administrator/components/com_banners/models/banner.php
Expand Up @@ -38,7 +38,7 @@ public function __construct($config = array())
/**
* Method to auto-populate the model state.
*/
protected function _populateState()
protected function populateState()
{
$app = JFactory::getApplication('administrator');

Expand Down
10 changes: 5 additions & 5 deletions administrator/components/com_banners/models/banners.php
Expand Up @@ -33,7 +33,7 @@ class BannersModelBanners extends JModelList
/**
* Method to auto-populate the model state.
*/
protected function _populateState()
protected function populateState()
{
// Initialise variables.
$app = JFactory::getApplication('administrator');
Expand All @@ -56,7 +56,7 @@ protected function _populateState()
$this->setState('params', $params);

// List state information.
parent::_populateState('name', 'asc');
parent::populateState('name', 'asc');
}

/**
Expand All @@ -83,23 +83,23 @@ public function getTable($type = 'Banner', $prefix = 'BannersTable', $config = a
*
* @return string A store id.
*/
protected function _getStoreId($id = '')
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.state');
$id .= ':'.$this->getState('filter.category_id');

return parent::_getStoreId($id);
return parent::getStoreId($id);
}

/**
* Build an SQL query to load the list data.
*
* @return JDatabaseQuery
*/
protected function _getListQuery()
protected function getListQuery()
{
// Get the application object
$app = &JFactory::getApplication();
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_banners/models/client.php
Expand Up @@ -38,7 +38,7 @@ public function __construct($config = array())
/**
* Method to auto-populate the model state.
*/
protected function _populateState()
protected function populateState()
{
$app = JFactory::getApplication('administrator');

Expand Down
10 changes: 5 additions & 5 deletions administrator/components/com_banners/models/clients.php
Expand Up @@ -28,7 +28,7 @@ class BannersModelClients extends JModelList
/**
* Method to auto-populate the model state.
*/
protected function _populateState()
protected function populateState()
{
// Initialise variables.
$app = JFactory::getApplication('administrator');
Expand All @@ -48,7 +48,7 @@ protected function _populateState()
$this->setState('params', $params);

// List state information.
parent::_populateState('a.name', 'asc');
parent::populateState('a.name', 'asc');
}

/**
Expand All @@ -62,23 +62,23 @@ protected function _populateState()
*
* @return string A store id.
*/
protected function _getStoreId($id = '')
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.state');
$id .= ':'.$this->getState('filter.category_id');

return parent::_getStoreId($id);
return parent::getStoreId($id);
}

/**
* Build an SQL query to load the list data.
*
* @return JDatabaseQuery
*/
protected function _getListQuery()
protected function getListQuery()
{
// Create a new query object.
$db = $this->getDbo();
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_banners/models/download.php
Expand Up @@ -23,7 +23,7 @@ class BannersModelDownload extends JModelForm
/**
* Method to auto-populate the model state.
*/
protected function _populateState()
protected function populateState()
{
jimport('joomla.utilities.utility');
$basename = JRequest::getString(JUtility::getHash($this->_context.'.basename'),'__SITE__','cookie');
Expand Down
6 changes: 3 additions & 3 deletions administrator/components/com_banners/models/tracks.php
Expand Up @@ -31,7 +31,7 @@ class BannersModelTracks extends JModelList
/**
* Method to auto-populate the model state.
*/
protected function _populateState()
protected function populateState()
{
// Initialise variables.
$app = JFactory::getApplication('administrator');
Expand All @@ -57,14 +57,14 @@ protected function _populateState()
$this->setState('params', $params);

// List state information.
parent::_populateState('name', 'asc');
parent::populateState('name', 'asc');
}
/**
* Build an SQL query to load the list data.
*
* @return JDatabaseQuery
*/
protected function _getListQuery()
protected function getListQuery()
{
// Get the application object
$app = &JFactory::getApplication();
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_cache/models/cache.php
Expand Up @@ -50,7 +50,7 @@ class CacheModelCache extends JModel
* @return void
* @since 1.6
*/
protected function _populateState()
protected function populateState()
{
$app = &JFactory::getApplication();

Expand Down
10 changes: 5 additions & 5 deletions administrator/components/com_categories/models/categories.php
Expand Up @@ -31,7 +31,7 @@ class CategoriesModelCategories extends JModelList
*
* @since 1.6
*/
protected function _populateState()
protected function populateState()
{
$app = JFactory::getApplication();

Expand All @@ -55,7 +55,7 @@ protected function _populateState()
$this->setState('filter.published', $published);

// List state information.
parent::_populateState('a.lft', 'asc');
parent::populateState('a.lft', 'asc');
}

/**
Expand All @@ -69,22 +69,22 @@ protected function _populateState()
*
* @return string A store id.
*/
protected function _getStoreId($id = '')
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
$id .= ':'.$this->getState('filter.extension');
$id .= ':'.$this->getState('filter.published');

return parent::_getStoreId($id);
return parent::getStoreId($id);
}

/**
* @param boolean True to join selected foreign information
*
* @return string
*/
function _getListQuery($resolveFKs = true)
function getListQuery($resolveFKs = true)
{
// Create a new query object.
$db = $this->getDbo();
Expand Down
Expand Up @@ -58,7 +58,7 @@ public function getTable($type = 'Category', $prefix = 'JTable', $config = array
*
* @return void
*/
protected function _populateState()
protected function populateState()
{
$app = &JFactory::getApplication('administrator');

Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_config/models/component.php
Expand Up @@ -23,7 +23,7 @@ class ConfigModelComponent extends JModelForm
*
* @since 1.6
*/
protected function _populateState()
protected function populateState()
{
// Set the component (option) we are dealing with.
$component = JRequest::getCmd('component');
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_contact/models/contact.php
Expand Up @@ -58,7 +58,7 @@ public function getTable($type = 'Contact', $prefix = 'ContactTable', $config =
*
* @return void
*/
protected function _populateState()
protected function populateState()
{
$app = &JFactory::getApplication('administrator');
// Load the User state.
Expand Down
10 changes: 5 additions & 5 deletions administrator/components/com_contact/models/contacts.php
Expand Up @@ -30,7 +30,7 @@ class ContactModelContacts extends JModelList
*
* @since 1.6
*/
protected function _populateState()
protected function populateState()
{
$app = JFactory::getApplication();

Expand All @@ -47,7 +47,7 @@ protected function _populateState()
$this->setState('filter.category_id', $categoryId);

// List state information.
parent::_populateState('a.name', 'asc');
parent::populateState('a.name', 'asc');
}

/**
Expand All @@ -61,21 +61,21 @@ protected function _populateState()
*
* @return string A store id.
*/
protected function _getStoreId($id = '')
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
$id .= ':'.$this->getState('filter.published');

return parent::_getStoreId($id);
return parent::getStoreId($id);
}

/**
* @param boolean True to join selected foreign information
*
* @return string
*/
function _getListQuery($resolveFKs = true)
function getListQuery($resolveFKs = true)
{
// Create a new query object.
$db = $this->getDbo();
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_content/models/article.php
Expand Up @@ -37,7 +37,7 @@ public function __construct($config = array())
/**
* Method to auto-populate the model state.
*/
protected function _populateState()
protected function populateState()
{
$app = JFactory::getApplication('administrator');

Expand Down
10 changes: 5 additions & 5 deletions administrator/components/com_content/models/articles.php
Expand Up @@ -30,7 +30,7 @@ class ContentModelArticles extends JModelList
*
* @since 1.6
*/
protected function _populateState()
protected function populateState()
{
// Initialise variables.
$app = JFactory::getApplication();
Expand All @@ -48,7 +48,7 @@ protected function _populateState()
$this->setState('filter.category_id', $categoryId);

// List state information.
parent::_populateState('a.title', 'asc');
parent::populateState('a.title', 'asc');
}

/**
Expand All @@ -63,23 +63,23 @@ protected function _populateState()
* @return string A store id.
* @since 1.6
*/
protected function _getStoreId($id = '')
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.state');
$id .= ':'.$this->getState('filter.category_id');

return parent::_getStoreId($id);
return parent::getStoreId($id);
}

/**
* Build an SQL query to load the list data.
*
* @return JDatabaseQuery
*/
protected function _getListQuery()
protected function getListQuery()
{
// Create a new query object.
$db = $this->getDbo();
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_content/models/featured.php
Expand Up @@ -30,7 +30,7 @@ class ContentModelFeatured extends ContentModelArticles
*
* @return string
*/
function _getListQuery($resolveFKs = true)
function getListQuery($resolveFKs = true)
{
// Create a new query object.
$db = $this->getDbo();
Expand Down
6 changes: 3 additions & 3 deletions administrator/components/com_installer/models/discover.php
Expand Up @@ -30,21 +30,21 @@ class InstallerModelDiscover extends InstallerModel
* to be called on the first call to the getState() method unless the model
* configuration flag to ignore the request is set.
*/
protected function _populateState() {
protected function populateState() {
$app = JFactory::getApplication();
$this->setState('message',$app->getUserState('com_installer.message'));
$this->setState('extension_message',$app->getUserState('com_installer.extension_message'));
$app->setUserState('com_installer.message','');
$app->setUserState('com_installer.extension_message','');
parent::_populateState('name','asc');
parent::populateState('name','asc');
}

/**
* Method to get the database query
*
* @return JDatabaseQuery the database query
*/
protected function _getListQuery() {
protected function getListQuery() {
$query = new JDatabaseQuery;
$query->select('*');
$query->from('#__extensions');
Expand Down
Expand Up @@ -46,7 +46,7 @@ protected function _getList($query, $limitstart = 0, $limit = 0) {
}
JArrayHelper::sortObjects($result, $this->getState('list.ordering'), $this->getState('list.direction') == 'desc' ? -1 : 1);
$total = count($result);
$this->_cache[$this->_getStoreId('getTotal')] = $total;
$this->_cache[$this->getStoreId('getTotal')] = $total;
if ($total < $limitstart) {
$limitstart = 0;
$this->setState('list.start', 0);
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_installer/models/install.php
Expand Up @@ -49,7 +49,7 @@ class InstallerModelInstall extends JModel
*
* @since 1.6
*/
protected function _populateState()
protected function populateState()
{
// Initialise variables.
$app = &JFactory::getApplication('administrator');
Expand All @@ -62,7 +62,7 @@ protected function _populateState()
// Remember the 'Install from Directory' path.
$path = $app->getUserStateFromRequest($this->_context.'.install_directory', 'install_directory', $app->getCfg('config.tmp_path'));
$this->setState('install.directory', $path);
parent::_populateState();
parent::populateState();
}

/**
Expand Down

0 comments on commit 0bdbbfe

Please sign in to comment.