当前位置: 首页>>代码示例>>PHP>>正文


PHP GetUtil::sanitizePostByDesignerTypeForSavingModel方法代码示例

本文整理汇总了PHP中GetUtil::sanitizePostByDesignerTypeForSavingModel方法的典型用法代码示例。如果您正苦于以下问题:PHP GetUtil::sanitizePostByDesignerTypeForSavingModel方法的具体用法?PHP GetUtil::sanitizePostByDesignerTypeForSavingModel怎么用?PHP GetUtil::sanitizePostByDesignerTypeForSavingModel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GetUtil的用法示例。


在下文中一共展示了GetUtil::sanitizePostByDesignerTypeForSavingModel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: makeRedBeanDataProviderByDataCollection

 /**
  * Utilizes information from the dataCollection object to
  * make a RedBeanDataProvider.  Either looks at saved search information or params in the $_GET array.
  * variables:
  *  modelName_sort
  *  modelName
  *  where modelName is Account for example.
  * Typically utilized by a listView action.
  */
 public function makeRedBeanDataProviderByDataCollection($searchModel, $pageSize, $stateMetadataAdapterClassName = null, $dataCollection = null)
 {
     assert('is_int($pageSize) || $pageSize == null');
     assert('$stateMetadataAdapterClassName == null || is_string($stateMetadataAdapterClassName)');
     assert('$dataCollection instanceof SearchAttributesDataCollection || $dataCollection == null');
     $listModelClassName = get_class($searchModel->getModel());
     if ($dataCollection == null) {
         $dataCollection = new SearchAttributesDataCollection($searchModel);
     }
     $searchAttributes = $dataCollection->resolveSearchAttributesFromSourceData();
     $dataCollection->resolveAnyMixedAttributesScopeForSearchModelFromSourceData();
     $dataCollection->resolveSelectedListAttributesForSearchModelFromSourceData();
     $dataCollection->resolveFilterByStarredFromSourceData();
     $dataCollection->resolveKanbanBoardOptionsForSearchModelFromSourceData();
     $sanitizedSearchAttributes = GetUtil::sanitizePostByDesignerTypeForSavingModel($searchModel, $searchAttributes);
     $sortAttribute = $dataCollection->resolveSortAttributeFromSourceData($listModelClassName);
     $sortDescending = $dataCollection->resolveSortDescendingFromSourceData($listModelClassName);
     $metadataAdapter = new SearchDataProviderMetadataAdapter($searchModel, Yii::app()->user->userModel->id, $sanitizedSearchAttributes);
     $metadata = static::resolveDynamicSearchMetadata($searchModel, $metadataAdapter->getAdaptedMetadata(), $dataCollection);
     $this->resolveKanbanBoardMetadataBeforeMakingDataProvider($searchModel, $metadata);
     $this->resolveMetadataBeforeMakingDataProvider($metadata);
     $dataProviderClassName = 'RedBeanModelDataProvider';
     if ($searchModel->filterByStarred) {
         $dataProviderClassName = 'StarredModelDataProvider';
     }
     return RedBeanModelDataProviderUtil::makeDataProvider($metadata, $listModelClassName, $dataProviderClassName, $sortAttribute, $sortDescending, $pageSize, $stateMetadataAdapterClassName);
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:36,代码来源:Controller.php

示例2: processDynamicSearchAttributesDataForSavingModelRecursively

 protected static function processDynamicSearchAttributesDataForSavingModelRecursively($searchModel, &$searchAttributeData)
 {
     $processRecursively = false;
     foreach ($searchAttributeData as $attributeName => $attributeData) {
         if (isset($attributeData['relatedModelData']) && is_array($attributeData) && $attributeData['relatedModelData'] == true) {
             assert('count($attributeData) == 2');
             $processRecursively = true;
             break;
         }
     }
     if ($processRecursively) {
         $modelToUse = self::resolveModelToUseByModelAndAttributeName($searchModel, $attributeName);
         self::processDynamicSearchAttributesDataForSavingModelRecursively($modelToUse, $searchAttributeData[$attributeName]);
     } else {
         $searchAttributeData = GetUtil::sanitizePostByDesignerTypeForSavingModel($searchModel, $searchAttributeData);
     }
 }
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:17,代码来源:SearchUtil.php


注:本文中的GetUtil::sanitizePostByDesignerTypeForSavingModel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。