本文整理汇总了PHP中DynamicField::saveExtendedAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP DynamicField::saveExtendedAttributes方法的具体用法?PHP DynamicField::saveExtendedAttributes怎么用?PHP DynamicField::saveExtendedAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DynamicField
的用法示例。
在下文中一共展示了DynamicField::saveExtendedAttributes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: upgradeVardefsInDeployedModules
/**
* Find custom address fields added to modules that modulebuilder created and deployed
*/
public function upgradeVardefsInDeployedModules()
{
//Created for access to a field's vardef_map
$tempField = new TemplateField();
foreach (glob('modules/*/vardefs.php') as $file) {
//Get module name from file name
$fileParts = explode('/', $file);
$module = $fileParts[1];
require $file;
if (!empty($dictionary[$module]['fields'])) {
//Set up vardef extension save mechanism
$bean = BeanFactory::getBean($module);
if (empty($bean)) {
continue;
}
$df = new DynamicField($module);
$df->setup($bean);
//Find all custom street fields
foreach ($dictionary[$module]['fields'] as $fieldName => $field) {
if ($this->validateStreetField($dictionary[$module]['fields'], $fieldName)) {
$upgradeField = new stdClass();
$upgradeField->type = 'text';
$upgradeField->dbType = 'varchar';
$upgradeField->name = $fieldName;
$upgradeField->vardef_map = $tempField->vardef_map;
$upgradeField->vardef_map['dbType'] = 'dbType';
$df->saveExtendedAttributes($upgradeField, array());
}
}
}
}
}