Source for file language.php
Documentation is available at language.php
* @package Joomla.Administrator
* @subpackage com_languages
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* Languages Component Language Model
* @package Joomla.Administrator
* @subpackage com_languages
* Override to get the table
public function getTable($name =
'', $prefix =
'', $options =
array())
* Method to auto-populate the model state.
* Note. Calling getState in this method will result in recursion.
$langId =
$app->input->getInt('lang_id');
$this->setState('language.id', $langId);
* Method to get a member item.
* @param integer The id of the member to get.
* @return mixed User data object on success, false on failure.
public function getItem($langId =
null)
$langId =
(!empty($langId)) ?
$langId : (int)
$this->getState('language.id');
// Get a member row instance.
// Attempt to load the row.
$return =
$table->load($langId);
// Check for a table object error.
if ($return ===
false &&
$table->getError())
$properties =
$table->getProperties(1);
* Method to get the group form.
* @param array $data Data for the form.
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
* @return mixed A JForm object on success, false on failure
public function getForm($data =
array(), $loadData =
true)
$form =
$this->loadForm('com_languages.language', 'language', array('control' =>
'jform', 'load_data' =>
$loadData));
* Method to get the data that should be injected in the form.
* @return mixed The data for the form.
// Check the session for previously entered form data.
* Method to save the form data.
* @param array The form data.
* @return boolean True on success.
public function save($data)
$langId = (int)
$this->getState('language.id');
// Load the row if saving an existing item.
if (!$table->bind($data))
// Trigger the onExtensionBeforeSave event.
$result =
$dispatcher->trigger('onExtensionBeforeSave', array('com_languages.language', &$table, $isNew));
// Check the event responses.
// Trigger the onExtensionAfterSave event.
$dispatcher->trigger('onExtensionAfterSave', array('com_languages.language', &$table, $isNew));
$this->setState('language.id', $table->lang_id);
* Custom clean cache method
protected function cleanCache($group =
null, $client_id =
0)
parent::cleanCache('_system');
parent::cleanCache('com_languages');
Documentation generated on Tue, 19 Nov 2013 15:06:30 +0100 by phpDocumentor 1.4.3