本文整理汇总了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 {
示例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;
}
示例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);
}