当前位置: 首页>>代码示例>>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;未经允许,请勿转载。