コード例 #1
0
ファイル: ThemeManager.php プロジェクト: ngydat/CoreBundle
 /**
  * Deletes a theme, including its css directory.
  *
  * @param Theme $theme
  * @throws \Exception if the theme is not a custom theme
  */
 public function deleteTheme(Theme $theme)
 {
     if (!$theme->isCustom()) {
         throw new \Exception("Stock theme '{$theme->getName()}' cannot be deleted");
     }
     $this->om->remove($theme);
     $this->om->flush();
     $fs = new Filesystem();
     $fs->remove("{$this->themeDir}/{$theme->getNormalizedName()}");
 }