Back to ApiMVCFactory class

Method createTable

public \Joomla\CMS\Table\Table
createTable
(mixed $name, mixed $prefix = '', array $config = array())
Method to load and return a table object.
Parameters
  • string $name The name of the table.
  • string $prefix Optional table prefix.
  • array $config Optional configuration array for the table.
Returns
  • \Joomla\CMS\Table\Table The table object
Since
  • 4.0.0
-
  • \Exception
Class: ApiMVCFactory
Project: Joomla

Method createTable - Source code

/**
 * Method to load and return a table object.
 *
 * @param   string  $name    The name of the table.
 * @param   string  $prefix  Optional table prefix.
 * @param   array   $config  Optional configuration array for the table.
 *
 * @return  \Joomla\CMS\Table\Table  The table object
 *
 * @since   4.0.0
 * @throws  \Exception
 */
public function createTable($name, $prefix = '', array $config = array())
{
    $table = parent::createTable($name, $prefix, $config);
    if (!$table) {
        $table = parent::createTable($name, 'Administrator', $config);
    }
    return $table;
}