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


PHP DynamicField::getModuleName方法代码示例

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


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

示例1: delete

 /**
  * @param DynamicField $df
  */
 function delete($df)
 {
     //If a dropdown uses the field that is being delted as a parent dropdown, we need to remove that dependency
     $seed = BeanFactory::getBean($df->getModuleName());
     if ($seed) {
         $fields = $seed->field_defs;
         foreach ($fields as $field => $def) {
             if (!empty($def['visibility_grid']['trigger']) && $def['visibility_grid']['trigger'] == $this->name) {
                 $field = get_widget($def['type']);
                 unset($def['visibility_grid']);
                 $field->populateFromRow($def);
                 if (isset($def['source']) && $def['source'] == "custom_fields") {
                     $field->save($df);
                 } else {
                     //Out of the box field that we need to use a StandardField rather than DynamicFIeld object to save
                     require_once 'modules/ModuleBuilder/parsers/StandardField.php';
                     $sf = new StandardField($df->getModuleName());
                     $sf->setup($seed);
                     $field->module = $seed;
                     $field->save($sf);
                 }
             }
         }
     }
     parent::delete($df);
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:29,代码来源:TemplateEnum.php

示例2: save

 /**
  * save
  *
  * This function says the field template by calling the DynamicField addFieldObject function.  It then
  * checks to see if updates are needed for the SearchFields.php file.  In the event that the unified_search
  * member variable is set to true, a search field definition is updated/created to the SearchFields.php file.
  *
  * @param DynamicField $df
  */
 function save($df)
 {
     //	    $GLOBALS['log']->debug('saving field: '.print_r($this,true));
     $df->addFieldObject($this);
     require_once 'modules/ModuleBuilder/parsers/parser.searchfields.php';
     $searchFieldParser = new ParserSearchFields($df->getModuleName(), $df->getPackageName());
     //If unified_search is enabled for this field, then create the SearchFields entry
     $fieldName = $this->get_field_name($df->getModuleName(), $this->name);
     if ($this->unified_search && !isset($searchFieldParser->searchFields[$df->getModuleName()][$fieldName])) {
         $searchFieldParser->addSearchField($fieldName, array('query_type' => 'default'));
         $searchFieldParser->saveSearchFields($searchFieldParser->searchFields);
     }
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:22,代码来源:TemplateField.php


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