/**
* Method to check if the extension is already present in the database
*
* @return void
*
* @since 3.4
* @throws \RuntimeException
*/
protected function checkExistingExtension()
{
try {
$this->currentExtensionId = $this->extension->find(array('element' => $this->element, 'type' => $this->type));
// If it does exist, load it
if ($this->currentExtensionId) {
$this->extension->load(array('element' => $this->element, 'type' => $this->type));
}
} catch (\RuntimeException $e) {
// Install failed, roll back changes
throw new \RuntimeException(Text::sprintf('JLIB_INSTALLER_ABORT_ROLLBACK', Text::_('JLIB_INSTALLER_' . $this->route), $e->getMessage()), $e->getCode(), $e);
}
}