本文整理匯總了PHP中DynamicField::dropField方法的典型用法代碼示例。如果您正苦於以下問題:PHP DynamicField::dropField方法的具體用法?PHP DynamicField::dropField怎麽用?PHP DynamicField::dropField使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DynamicField
的用法示例。
在下文中一共展示了DynamicField::dropField方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: FieldsMetaData
* Portions created by SugarCRM are Copyright (C) 2004-2006 SugarCRM, Inc.;
* All Rights Reserved.
* Contributor(s): ______________________________________.
********************************************************************************/
require_once 'modules/EditCustomFields/EditCustomFields.php';
require_once 'modules/DynamicFields/DynamicField.php';
require_once 'modules/DynamicFields/DynamicField.php';
if (!empty($_REQUEST['record'])) {
$fields_meta_data = new FieldsMetaData($_REQUEST['record']);
$fields_meta_data->retrieve($_REQUEST['record']);
$module = $fields_meta_data->custom_module;
$custom_fields = new DynamicField($module);
if (!empty($module)) {
$class_name = $beanList[$module];
$class_file = $class_name;
if ($class_file == 'aCase') {
$class_file = 'Case';
}
require_once "modules/{$module}/{$class_file}.php";
$mod = new $class_name();
$custom_fields->setup($mod);
} else {
echo "\nNo Module Included Could Not Delete";
}
$custom_fields->dropField($fields_meta_data->name);
$fields_meta_data->mark_deleted($_REQUEST['record']);
}
$return_module = empty($_REQUEST['return_module']) ? 'EditCustomFields' : $_REQUEST['return_module'];
$return_action = empty($_REQUEST['return_action']) ? 'index' : $_REQUEST['return_action'];
$return_module_select = empty($_REQUEST['module_name']) ? 0 : $_REQUEST['module_name'];
header("Location: index.php?action={$return_action}&module={$return_module}&module_name={$return_module_select}");
示例2: DynamicField
function uninstall_custom_fields($fields)
{
global $beanList, $beanFiles;
require_once 'modules/DynamicFields/DynamicField.php';
$dyField = new DynamicField();
foreach ($fields as $field) {
$class = $beanList[$field['module']];
if (file_exists($beanFiles[$class])) {
require_once $beanFiles[$class];
$mod = new $class();
$dyField->bean = $mod;
$dyField->module = $field['module'];
$dyField->dropField($field['name']);
}
}
}