コード例 #1
0
 public static function getEntityTemplatesAsOptions($strType)
 {
     $arrOptions = array();
     if (($objEntityTemplates = \HeimrichHannot\EntityGenerator\EntityTemplateModel::findBy('type', $strType)) !== null) {
         $arrOptions = array_combine($objEntityTemplates->fetchEach('id'), $objEntityTemplates->fetchEach('title'));
         asort($arrOptions);
     }
     return $arrOptions;
 }
コード例 #2
0
 protected static function prepareData($objEntityTemplate)
 {
     if ($objEntityTemplate->addParentDca) {
         if (($objParent = EntityTemplateModel::findByPk($objEntityTemplate->parentDca)) !== null) {
             $objEntityTemplate->parentDcaName = $objParent->dcaName;
         }
     }
     // multicolumnwizard fields
     foreach (static::$arrMultiColumnWizardFields as $strField) {
         $objEntityTemplate->{$strField} = deserialize($objEntityTemplate->{$strField}, true);
         $objEntityTemplate->{$strField} = static::transformSingleDimensionalMcwArrays($strField, $objEntityTemplate->{$strField});
     }
     // publish
     if ($objEntityTemplate->addPublish && !in_array('toggle', $objEntityTemplate->operations)) {
         $objEntityTemplate->operations = array_merge($objEntityTemplate->operations, array('toggle'));
     }
 }