當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DynamicField::addFieldObject方法代碼示例

本文整理匯總了PHP中DynamicField::addFieldObject方法的典型用法代碼示例。如果您正苦於以下問題:PHP DynamicField::addFieldObject方法的具體用法?PHP DynamicField::addFieldObject怎麽用?PHP DynamicField::addFieldObject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DynamicField的用法示例。


在下文中一共展示了DynamicField::addFieldObject方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setUp

 /**
  * Creating new field, account, contact with filled custom field, relationship between them
  */
 public function setUp()
 {
     SugarTestHelper::setUp('beanList');
     SugarTestHelper::setUp('beanFiles');
     SugarTestHelper::setUp('current_user', array(true, true));
     $this->field = get_widget('varchar');
     $this->field->id = 'Contactstest_c';
     $this->field->name = 'test_c';
     $this->field->type = 'varchar';
     $this->field->len = 255;
     $this->field->importable = 'true';
     $this->field->label = '';
     $this->module = new Contact();
     $this->dynamicField = new DynamicField('Contacts');
     $this->dynamicField->setup($this->module);
     $this->dynamicField->addFieldObject($this->field);
     SugarTestHelper::setUp('dictionary');
     $GLOBALS['reload_vardefs'] = true;
     $this->account = SugarTestAccountUtilities::createAccount();
     $this->contact = SugarTestContactUtilities::createContact();
     $this->contact->account_id = $this->account->id;
     $this->contact->test_c = 'test value';
     $this->contact->load_relationship('accounts');
     $this->contact->accounts->add($this->account->id);
     $this->contact->save();
     $GLOBALS['db']->commit();
 }
開發者ID:butschster,項目名稱:sugarcrm_dev,代碼行數:30,代碼來源:Bug58138Test.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::addFieldObject方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。