Back to TemplateAdapter class

Method parseQueries

protected void
parseQueries
()
Overloaded method to parse queries for template installations
Returns
  • void
Since
  • 3.4
-
  • \RuntimeException

Method parseQueries - Source code

/**
 * Overloaded method to parse queries for template installations
 *
 * @return  void
 *
 * @since   3.4
 * @throws  \RuntimeException
 */
protected function parseQueries()
{
    if (\in_array($this->route, array('install', 'discover_install'))) {
        $db = $this->db;
        $query = $db->getQuery(true);
        $lang = Factory::getLanguage();
        $debug = $lang->setDebug(false);
        $columns = [$db->quoteName('template'), $db->quoteName('client_id'), $db->quoteName('home'), $db->quoteName('title'), $db->quoteName('params'), $db->quoteName('inheritable'), $db->quoteName('parent')];
        $values = $query->bindArray([$this->extension->element, $this->extension->client_id, '0', Text::sprintf('JLIB_INSTALLER_DEFAULT_STYLE', Text::_($this->extension->name)), $this->extension->params, (int) $this->manifest->inheritable, (string) $this->manifest->parent ?: ''], [ParameterType::STRING, ParameterType::INTEGER, ParameterType::STRING, ParameterType::STRING, ParameterType::STRING, ParameterType::INTEGER, ParameterType::STRING]);
        $lang->setDebug($debug);
        // Insert record in #__template_styles
        $query->insert($db->quoteName('#__template_styles'))->columns($columns)->values(implode(',', $values));
        // There is a chance this could fail but we don't care...
        $db->setQuery($query)->execute();
    }
}