コード例 #1
0
 /**
  *
  * @param <type> $columns
  * @return DisplayField 
  */
 public function saveCustomDisplayField($columns)
 {
     try {
         if (array_key_exists('displayFieldId', $columns)) {
             $displayField = Doctrine::getTable("DisplayField")->find($columns['displayFieldId']);
             $displayField->setLabel($columns['label']);
         } else {
             $displayField = new DisplayField();
             $displayField->setReportGroupId($columns['reportGroupId']);
             $displayField->setName($columns['name']);
             $displayField->setLabel($columns['label']);
             $displayField->setFieldAlias($columns['fieldAlias']);
             $displayField->setIsSortable($columns['isSortable']);
             $displayField->setSortOrder($columns['sortOrder']);
             $displayField->setSortField($columns['sortField']);
             $displayField->setElementType($columns['elementType']);
             $displayField->setElementProperty($columns['elementProperty']);
             $displayField->setWidth($columns['width']);
             $displayField->setIsExportable($columns['isExportable']);
             $displayField->setTextAlignmentStyle($columns['textAlignmentStyle']);
             $displayField->setIsValueList($columns['isValueList']);
             $displayField->setDisplayFieldGroupId($columns['displayFieldGroupId']);
             $displayField->setDefaultValue($columns['defaultValue']);
             $displayField->setIsEncrypted($columns['isEncrypted']);
         }
         $displayField->save();
         return $displayField;
     } catch (Exception $ex) {
         throw new DaoException($ex->getMessage());
     }
 }