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


PHP Vtiger_Functions::getEntityModuleInfoFieldsFormatted方法代碼示例

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


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

示例1: getWhereClause


//.........這裏部分代碼省略.........
                         $columnList = array();
                         foreach ($nameFieldList as $column) {
                             if ($module == 'Users') {
                                 $instance = CRMEntity::getInstance($module);
                                 $referenceTable = $instance->table_name;
                                 if (count($this->ownerFields) > 0 || $this->getModule() == 'Quotes') {
                                     $referenceTable .= $fieldName;
                                 }
                             } else {
                                 $referenceField = $meta->getFieldByColumnName($column);
                                 $referenceTable = $referenceField->getTableName() . $fieldName;
                             }
                             if (isset($moduleTableIndexList[$referenceTable])) {
                                 $referenceTable = "{$referenceTable}{$fieldName}";
                             }
                             $columnList[$column] = "{$referenceTable}.{$column}";
                         }
                         if (count($columnList) > 1) {
                             $columnSql = getSqlForNameInDisplayFormat($columnList, $module);
                         } else {
                             $columnSql = implode('', $columnList);
                         }
                         $fieldSql .= "{$fieldGlue} trim({$columnSql}) {$valueSql}";
                         $fieldGlue = ' OR';
                     }
                 }
             } elseif (in_array($fieldName, $this->ownerFields)) {
                 if ($conditionInfo['operator'] == 'om') {
                     $fieldSql .= $fieldGlue . $field->getTableName() . '.' . $field->getColumnName() . " {$valueSql}";
                 } elseif ($fieldName == 'created_user_id') {
                     $concatSql = getSqlForNameInDisplayFormat(array('first_name' => "vtiger_users{$fieldName}.first_name", 'last_name' => "vtiger_users{$fieldName}.last_name"), 'Users');
                     $fieldSql .= "{$fieldGlue} (trim({$concatSql}) {$valueSql})";
                 } else {
                     $entityFields = Vtiger_Functions::getEntityModuleInfoFieldsFormatted('Users');
                     if (count($entityFields['fieldname']) > 1) {
                         $columns = [];
                         foreach ($entityFields['fieldname'] as $i => $fieldname) {
                             $columns[$fieldname] = $entityFields['tablename'] . '.' . $fieldname;
                         }
                         $concatSql = getSqlForNameInDisplayFormat($columns, 'Users');
                         $fieldSql .= "{$fieldGlue} (trim({$concatSql}) {$valueSql} OR " . "vtiger_groups.groupname {$valueSql})";
                     } else {
                         $columnSql = $entityFields['tablename'] . '.' . $entityFields['fieldname'];
                         $fieldSql .= "{$fieldGlue} (trim({$columnSql}) {$valueSql} OR " . "vtiger_groups.groupname {$valueSql})";
                     }
                 }
             } elseif ($field->getFieldDataType() == 'date' && ($baseModule == 'Events' || $baseModule == 'Calendar') && ($fieldName == 'date_start' || $fieldName == 'due_date')) {
                 $value = $conditionInfo['value'];
                 $operator = $conditionInfo['operator'];
                 if ($fieldName == 'date_start') {
                     $dateFieldColumnName = 'vtiger_activity.date_start';
                     $timeFieldColumnName = 'vtiger_activity.time_start';
                 } else {
                     $dateFieldColumnName = 'vtiger_activity.due_date';
                     $timeFieldColumnName = 'vtiger_activity.time_end';
                 }
                 if ($operator == 'bw') {
                     $values = explode(',', $value);
                     $startDateValue = explode(' ', $values[0]);
                     $endDateValue = explode(' ', $values[1]);
                     if (count($startDateValue) == 2 && count($endDateValue) == 2) {
                         $fieldSql .= " CAST(CONCAT({$dateFieldColumnName},' ',{$timeFieldColumnName}) AS DATETIME) {$valueSql}";
                     } else {
                         $fieldSql .= "{$dateFieldColumnName} {$valueSql}";
                     }
                 } else {
開發者ID:artisan4710,項目名稱:YetiForceCRM,代碼行數:67,代碼來源:QueryGenerator.php

示例2: getSqlForNameInDisplayFormat

 static function getSqlForNameInDisplayFormat($input, $module, $glue = ' ')
 {
     $entity_field_info = Vtiger_Functions::getEntityModuleInfoFieldsFormatted($module);
     $fieldsName = $entity_field_info['fieldname'];
     if (is_array($fieldsName)) {
         foreach ($fieldsName as $key => $value) {
             $formattedNameList[] = $input[$value];
         }
         $formattedNameListString = implode(",'" . $glue . "',", $formattedNameList);
     } else {
         $formattedNameListString = $input[$fieldsName];
     }
     $sqlString = "CONCAT(" . $formattedNameListString . ")";
     return $sqlString;
 }
開發者ID:yozhi,項目名稱:YetiForceCRM,代碼行數:15,代碼來源:Deprecated.php

示例3: getEntityFieldNames

/**
 * this function returns the entity information for a given module; for e.g. for Contacts module
 * it returns the information of tablename, modulename, fieldsname and id gets from vtiger_entityname
 * @param string $module - the module name
 * @return array $data - the entity information for the module
 */
function getEntityFieldNames($module)
{
    return Vtiger_Functions::getEntityModuleInfoFieldsFormatted($module);
}
開發者ID:jmangarret,項目名稱:vtigercrm,代碼行數:10,代碼來源:CommonUtils.php


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