当前位置: 首页>>代码示例>>PHP>>正文


PHP SugarBean::get_importable_fields方法代码示例

本文整理汇总了PHP中SugarBean::get_importable_fields方法的典型用法代码示例。如果您正苦于以下问题:PHP SugarBean::get_importable_fields方法的具体用法?PHP SugarBean::get_importable_fields怎么用?PHP SugarBean::get_importable_fields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SugarBean的用法示例。


在下文中一共展示了SugarBean::get_importable_fields方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getDuplicateCheckIndexedFiles

 public function getDuplicateCheckIndexedFiles()
 {
     require_once 'include/export_utils.php';
     $import_fields = $this->_focus->get_importable_fields();
     $importable_keys = array_keys($import_fields);
     //
     $index_array = array();
     $fields_used = array();
     $mstr_exclude_array = array('all' => array('team_set_id', 'id', 'deleted'), 'contacts' => array('email2'), array('leads' => 'reports_to_id'), array('prospects' => 'tracker_key'));
     //create exclude array from subset of applicable mstr_exclude_array elements
     $exclude_array = isset($mstr_exclude_array[strtolower($this->_focus->module_dir)]) ? array_merge($mstr_exclude_array[strtolower($this->_focus->module_dir)], $mstr_exclude_array['all']) : $mstr_exclude_array['all'];
     //process all fields belonging to indexes
     foreach ($this->_getIndexVardefs() as $index) {
         if ($index['type'] == "index") {
             foreach ($index['fields'] as $field) {
                 $fieldName = '';
                 //skip this field if it is the deleted field, not in the importable keys array, or a field in the exclude array
                 if (!in_array($field, $importable_keys) || in_array($field, $exclude_array)) {
                     continue;
                 }
                 $fieldDef = $this->_focus->getFieldDefinition($field);
                 //skip if this field is already defined (from another index)
                 if (in_array($fieldDef['name'], $fields_used)) {
                     continue;
                 }
                 //get the proper export label
                 $fieldName = translateForExport($fieldDef['name'], $this->_focus);
                 $index_array[$index['name'] . '::' . $fieldDef['name']] = $fieldName;
                 $fields_used[] = $fieldDef['name'];
             }
         }
     }
     //special handling for beans with first_name and last_name
     if (in_array('first_name', $fields_used) && in_array('last_name', $fields_used)) {
         //since both full name and last name fields have been mapped, add full name index
         $index_array['full_name::full_name'] = translateForExport('full_name', $this->_focus);
         $fields_used[] = 'full_name';
     }
     asort($index_array);
     return $index_array;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:41,代码来源:ImportDuplicateCheck.php


注:本文中的SugarBean::get_importable_fields方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。