本文整理汇总了PHP中WebserviceField::getColumnName方法的典型用法代码示例。如果您正苦于以下问题:PHP WebserviceField::getColumnName方法的具体用法?PHP WebserviceField::getColumnName怎么用?PHP WebserviceField::getColumnName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebserviceField
的用法示例。
在下文中一共展示了WebserviceField::getColumnName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getConditionValue
/**
*
* @param mixed $value
* @param String $operator
* @param WebserviceField $field
*/
private function getConditionValue($value, $operator, $field, $referenceFieldName = '')
{
$operator = strtolower($operator);
$db = PearDatabase::getInstance();
$noncommaSeparatedFieldTypes = array('currency', 'percentage', 'double', 'integer', 'number');
if (in_array($field->getFieldDataType(), $noncommaSeparatedFieldTypes)) {
if (is_array($value)) {
$valueArray = $value;
} else {
$valueArray = array($value);
}
// if ($field->getFieldDataType() == 'multipicklist' && in_array($operator, array('e', 'n'))) {
// $valueArray = getCombinations($valueArray);
// foreach ($valueArray as $key => $value) {
// $valueArray[$key] = ltrim($value, ' |##| ');
// }
// }
} elseif (is_string($value)) {
$valueArray = explode(',', $value);
} elseif (is_array($value)) {
$valueArray = $value;
} else {
$valueArray = array($value);
}
$sql = array();
if ($operator == 'exists') {
global $current_user, $adb;
$mid = getTabModuleName($field->getTabId());
$qg = new QueryGenerator($mid, $current_user);
$qg->addCondition($field->getFieldName(), $value, 'e');
$sql[] = 'SELECT EXISTS(SELECT 1 ' . $qg->getFromClause() . $qg->getWhereClause() . ')';
return $sql;
}
if ($operator == 'i' or $operator == 'in' or $operator == 'ni' or $operator == 'nin') {
$vals = array_map(array($db, 'quote'), $valueArray);
$sql[] = (($operator == 'ni' or $operator == 'nin') ? ' NOT ' : '') . 'IN (' . implode(',', $vals) . ')';
return $sql;
}
if ($operator == 'between' || $operator == 'bw' || $operator == 'notequal') {
if ($field->getFieldName() == 'birthday') {
$valueArray[0] = getValidDBInsertDateTimeValue($valueArray[0]);
$valueArray[1] = getValidDBInsertDateTimeValue($valueArray[1]);
$sql[] = "BETWEEN DATE_FORMAT(" . $db->quote($valueArray[0]) . ", '%m%d') AND " . "DATE_FORMAT(" . $db->quote($valueArray[1]) . ", '%m%d')";
} else {
if ($this->isDateType($field->getFieldDataType())) {
$valueArray[0] = getValidDBInsertDateTimeValue($valueArray[0]);
$valueArray[1] = getValidDBInsertDateTimeValue($valueArray[1]);
}
$sql[] = "BETWEEN " . $db->quote($valueArray[0]) . " AND " . $db->quote($valueArray[1]);
}
return $sql;
}
$yes = strtolower(getTranslatedString('yes'));
$no = strtolower(getTranslatedString('no'));
foreach ($valueArray as $value) {
if (!$this->isStringType($field->getFieldDataType())) {
$value = trim($value);
}
if ($operator == 'empty' || $operator == 'y') {
$sql[] = sprintf("IS NULL OR %s = ''", $referenceFieldName == '' ? $this->getSQLColumn($field->getFieldName(), false) : $referenceFieldName . '.' . $field->getColumnName());
continue;
}
if ($operator == 'ny') {
$sql[] = sprintf("IS NOT NULL AND %s != ''", $referenceFieldName == '' ? $this->getSQLColumn($field->getFieldName(), false) : $referenceFieldName . '.' . $field->getColumnName());
continue;
}
if (strtolower(trim($value)) == 'null' || trim($value) == '' && !$this->isStringType($field->getFieldDataType()) && ($operator == 'e' || $operator == 'n')) {
if ($operator == 'e') {
$sql[] = "IS NULL";
continue;
}
$sql[] = "IS NOT NULL";
continue;
} elseif ($field->getFieldDataType() == 'boolean') {
$value = strtolower($value);
if ($value == 'yes' or $value == $yes) {
$value = 1;
} elseif ($value == 'no' or $value == $no) {
$value = 0;
}
} elseif ($this->isDateType($field->getFieldDataType())) {
$value = getValidDBInsertDateTimeValue($value);
if (empty($value)) {
$sql[] = 'IS NULL or ' . $field->getTableName() . '.' . $field->getColumnName() . " = ''";
return $sql;
}
} elseif ($field->getFieldDataType() == 'picklist' || $field->getFieldDataType() == 'multipicklist') {
if (!isValueInPicklist($value, $field->getFieldName())) {
$value = getTranslationKeyFromTranslatedValue($this->module, $value);
}
} else {
if ($field->getFieldDataType() === 'currency') {
$uiType = $field->getUIType();
if ($uiType == 72) {
//.........这里部分代码省略.........