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


PHP Vtiger_Functions::getModuleFieldInfoWithId方法代碼示例

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


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

示例1: reloadValue

 /**
  * Update the value for relation
  * @param string $sourceModule Source module name
  * @param int $sourceRecord Source record
  */
 public function reloadValue($sourceModule, $sourceRecord)
 {
     $currentUser = vglobal('current_user');
     $user = new Users();
     vglobal('current_user', $user->retrieveCurrentUserInfoFromFile(Users::getActiveAdminId()));
     vglobal('currentModule', $sourceModule);
     $db = PearDatabase::getInstance();
     $params = $this->get('field')->getFieldParams();
     $sourceRecordModel = Vtiger_Record_Model::getInstanceById($sourceRecord, $sourceModule);
     $targetModel = Vtiger_RelationListView_Model::getInstance($sourceRecordModel, $params['module']);
     $fieldInfo = Vtiger_Functions::getModuleFieldInfoWithId($params['field']);
     $query = $targetModel->getRelationQuery();
     $explodedQuery = explode('FROM', $query, 2);
     $relationQuery = 'SELECT DISTINCT ' . $fieldInfo['columnname'] . ' FROM' . $explodedQuery[1] . ' AND ' . $fieldInfo['columnname'] . " <> ''";
     vglobal('current_user', $currentUser);
     $result = $db->query($relationQuery);
     $currentValue = self::COMMA;
     while ($value = $db->getSingleValue($result)) {
         $currentValue .= $value . self::COMMA;
     }
     $db->update($this->get('field')->get('table'), [$this->get('field')->get('column') => $currentValue], $sourceRecordModel->getEntity()->tab_name_index[$this->get('field')->get('table')] . ' = ?', [$sourceRecord]);
 }
開發者ID:awflu,項目名稱:YetiForceCRM,代碼行數:27,代碼來源:MultiReferenceValue.php

示例2: getInstanceFromFieldId

 public static function getInstanceFromFieldId($fieldId, $moduleTabId = false)
 {
     $fieldModel = Vtiger_Cache::get('FieldModel', $fieldId);
     if ($fieldModel) {
         return $fieldModel;
     }
     $field = Vtiger_Functions::getModuleFieldInfoWithId($fieldId);
     $fieldModel = new self();
     $fieldModel->initialize($field);
     Vtiger_Cache::set('FieldModel', $fieldId, $fieldModel);
     return $fieldModel;
 }
開發者ID:reeid,項目名稱:YetiForceCRM,代碼行數:12,代碼來源:Field.php


注:本文中的Vtiger_Functions::getModuleFieldInfoWithId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。