當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。