Back to UCMType class

Method __construct

public
__construct
(mixed $alias = null, \Joomla\Database\DatabaseDriver $database = null, \Joomla\Application\AbstractApplication $application = null)
Class constructor
Parameters
  • string $alias The alias for the item
  • \Joomla\Database\DatabaseDriver $database The database object
  • \Joomla\Application\AbstractApplication $application The application object
Since
  • 3.1
Class: UCMType
Project: Joomla

Method __construct - Source code

/**
 * Class constructor
 *
 * @param   string               $alias        The alias for the item
 * @param   DatabaseDriver       $database     The database object
 * @param   AbstractApplication  $application  The application object
 *
 * @since   3.1
 */
public function __construct($alias = null, DatabaseDriver $database = null, AbstractApplication $application = null)
{
    $this->db = $database ?: Factory::getDbo();
    $app = $application ?: Factory::getApplication();
    // Make the best guess we can in the absence of information.
    $this->alias = $alias ?: $app->input->get('option') . '.' . $app->input->get('view');
    $this->type = $this->getTypeByAlias($this->alias);
}