本文整理汇总了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);
}
}