public function removeTheme($theme)
{
Validation::notEmpty($theme, 'theme');
if (!$theme instanceof Theme) {
$theme = $this->findById($theme);
}
$themePath = $theme->getPath();
$themes = array();
if (!$this->getOutputSettingIssueService()->isThemeUsed($themePath, $themes)) {
$this->rrmdir($this->toFullPath($themePath));
$this->getSyncResourceService()->clearAllFor($themePath);
// Reset the theme configs cache so also the new theme will be avaialable
$this->cacheThemeConfigs = NULL;
return true;
}
throw new RemoveThemeException(implode(', ', $themes));
}