当前位置: 首页>>代码示例>>PHP>>正文


PHP DatabaseCompatibilityUtil::getOperatorAndValueWherePart方法代码示例

本文整理汇总了PHP中DatabaseCompatibilityUtil::getOperatorAndValueWherePart方法的典型用法代码示例。如果您正苦于以下问题:PHP DatabaseCompatibilityUtil::getOperatorAndValueWherePart方法的具体用法?PHP DatabaseCompatibilityUtil::getOperatorAndValueWherePart怎么用?PHP DatabaseCompatibilityUtil::getOperatorAndValueWherePart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DatabaseCompatibilityUtil的用法示例。


在下文中一共展示了DatabaseCompatibilityUtil::getOperatorAndValueWherePart方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addWherePartByClauseInformationForConcatedAttributes

 /**
  * Add a sql string to the where array base on the $operatorType, $value and $tableAliasAndColumnNames concated
  * together.  How the sql string is built depends on if the value is a string or not.
  * @param string $operatorType
  * @param mixed $value
  * @param array $where
  * @param integer $whereKey
  * @param array $tableAliasAndColumnNames
  */
 protected static function addWherePartByClauseInformationForConcatedAttributes($operatorType, $value, &$where, $whereKey, $tableAliasAndColumnNames)
 {
     assert('is_string($operatorType)');
     assert('is_array($where)');
     assert('is_int($whereKey)');
     assert('is_array($tableAliasAndColumnNames) && count($tableAliasAndColumnNames) == 2');
     $quote = DatabaseCompatibilityUtil::getQuote();
     if (is_string($value) || is_array($value) && count($value) > 0 || $value !== null) {
         $first = ModelJoinBuilder::makeColumnNameWithTableAlias($tableAliasAndColumnNames[0][0], $tableAliasAndColumnNames[0][1]);
         $second = ModelJoinBuilder::makeColumnNameWithTableAlias($tableAliasAndColumnNames[1][0], $tableAliasAndColumnNames[1][1]);
         $concatedSqlPart = DatabaseCompatibilityUtil::concat(array($first, '\' \'', $second));
         $where[$whereKey] = "({$concatedSqlPart} " . DatabaseCompatibilityUtil::getOperatorAndValueWherePart($operatorType, $value) . ")";
     }
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:23,代码来源:ModelDataProviderUtil.php

示例2: testGetOperatorAndValueWherePartForNullOrEmpty

 public function testGetOperatorAndValueWherePartForNullOrEmpty()
 {
     $queryPart = DatabaseCompatibilityUtil::getOperatorAndValueWherePart('isNull', null);
     $compareQueryPart = "IS NULL";
     // Not Coding Standard
     $this->assertEquals($compareQueryPart, $queryPart);
     $queryPart = DatabaseCompatibilityUtil::getOperatorAndValueWherePart('isNotNull', null);
     $compareQueryPart = "IS NOT NULL";
     // Not Coding Standard
     $this->assertEquals($compareQueryPart, $queryPart);
     $queryPart = DatabaseCompatibilityUtil::getOperatorAndValueWherePart('isEmpty', null);
     $compareQueryPart = "= ''";
     // Not Coding Standard
     $this->assertEquals($compareQueryPart, $queryPart);
     $queryPart = DatabaseCompatibilityUtil::getOperatorAndValueWherePart('isNotEmpty', null);
     $compareQueryPart = "!= ''";
     // Not Coding Standard
     $this->assertEquals($compareQueryPart, $queryPart);
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:19,代码来源:DatabaseCompatibilityUtilTest.php

示例3: addWherePartByClauseInformation

 /**
  * Add a sql string to the where array. How the sql string is built depends on if the value is a string or not.
  * @param $operatorType
  * @param $value
  * @param $where
  * @param $whereKey
  * @param $tableAliasName
  * @param $columnName
  */
 protected function addWherePartByClauseInformation($operatorType, $value, &$where, $whereKey, $tableAliasName, $columnName)
 {
     assert('is_string($operatorType)');
     assert('is_array($where)');
     assert('is_int($whereKey)');
     assert('is_string($tableAliasName)');
     assert('is_string($columnName)');
     if (is_string($value) || is_array($value) && count($value) > 0 || $value !== null || $value === null && SQLOperatorUtil::doesOperatorTypeAllowNullValues($operatorType)) {
         $where[$whereKey] = "(" . self::resolveWhereColumnContentForModifier($tableAliasName, $columnName) . " " . DatabaseCompatibilityUtil::getOperatorAndValueWherePart($operatorType, $value) . ")";
     }
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:20,代码来源:ModelWhereAndJoinBuilder.php


注:本文中的DatabaseCompatibilityUtil::getOperatorAndValueWherePart方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。