Back to LanguageAdapter class

Method finaliseUninstall

protected bool
finaliseUninstall
()
Method to finalise the uninstallation processing
Returns
  • bool
Since
  • 4.0.0
-
  • \RuntimeException

Method finaliseUninstall - Source code

/**
 * Method to finalise the uninstallation processing
 *
 * @return  boolean
 *
 * @since   4.0.0
 * @throws  \RuntimeException
 */
protected function finaliseUninstall() : bool
{
    if ($this->ignoreUninstallQueries) {
        return false;
    }
    $this->resetUserLanguage();
    $extensionId = $this->extension->extension_id;
    // Remove the schema version
    $db = Factory::getDbo();
    $query = $db->getQuery(true)->delete($db->quoteName('#__schemas'))->where($db->quoteName('extension_id') . ' = :extension_id')->bind(':extension_id', $extensionId, ParameterType::INTEGER);
    $db->setQuery($query);
    $db->execute();
    // Clobber any possible pending updates
    $update = Table::getInstance('update');
    $uid = $update->find(['element' => $this->extension->element, 'type' => $this->type]);
    if ($uid) {
        $update->delete($uid);
    }
    // Clean installed languages cache.
    Factory::getCache()->clean('com_languages');
    // Remove the extension table entry
    $this->extension->delete();
    return true;
}