It is a method to get a table object, load it if necessary.
public function getTable($name = '', $prefix = 'Table', $options = array())
{
if (empty($name))
{
$name = $this->getName();
}
if ($table = $this->_createTable($name, $prefix, $options))
{
return $table;
}
throw new \Exception(\JText::sprintf('JLIB_APPLICATION_ERROR_TABLE_NAME_NOT_SUPPORTED', $name), 0);
}
The method uses another protected method: _createTable()
It is a method to load and return a model object.
protected function _createTable($name, $prefix = 'Table', $config = array())
{
// Clean the model name
$name = preg_replace('/[^A-Z0-9_]/i', '', $name);
$prefix = preg_replace('/[^A-Z0-9_]/i', '', $prefix);
// Make sure we are returning a DBO object
if (!array_key_exists('dbo', $config))
{
$config['dbo'] = $this->getDbo();
}
return \JTable::getInstance($name, $prefix, $config);
}