/**
  * Get the asset group by ID
  *
  * @param int $id
  *
  * @return BaseGroup|null
  *
  * @throws \Exception
  */
 public static function getAssetGroupById($id)
 {
     $model = AssetGroupModel::findByPk($id);
     if ($model === null) {
         throw new \Exception(sprintf('Unable to find the asset group ID %s', $id));
     }
     return static::getAssetGroupByModel($model);
 }
 /**
  * Get the editor sheets of the current theme
  *
  * @param \DataContainer $dc
  *
  * @return array
  */
 public function getEditorSheets(\DataContainer $dc)
 {
     $assetModel = AssetModel::findByPk($dc->id);
     $groupModel = AssetGroupModel::findByPk($assetModel->pid);
     $sheetModels = \StyleSheetModel::findBy('pid', $groupModel->pid, array('order' => 'name'));
     if ($sheetModels === null) {
         return array();
     }
     $return = array();
     foreach ($sheetModels as $sheetModel) {
         $return[$sheetModel->id] = $sheetModel->name;
     }
     return $return;
 }