Back to LibraryAdapter 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
{
    $extensionId = $this->extension->extension_id;
    $db = $this->parent->getDbo();
    // Remove the schema version
    $query = $db->getQuery(true)->delete('#__schemas')->where('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);
    }
    $this->extension->delete();
    return true;
}