本文整理匯總了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);
}
示例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);
}
}