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


PHP DatabaseCompatibilityUtil::concat方法代碼示例

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


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

示例1: getUsersByPartialFullName

 /**
  * For a give User name, run a partial search by
  * full name and retrieve user models.
  *
  */
 public static function getUsersByPartialFullName($partialName, $pageSize)
 {
     assert('is_string($partialName)');
     assert('is_int($pageSize)');
     $personTableName = RedBeanModel::getTableName('Person');
     $joinTablesAdapter = new RedBeanModelJoinTablesQueryAdapter('User');
     $joinTablesAdapter->addFromTableAndGetAliasName($personTableName, "{$personTableName}_id");
     $fullNameSql = DatabaseCompatibilityUtil::concat(array('person.firstname', '\' \'', 'person.lastname'));
     $where = "      (person.firstname      like lower('{$partialName}%') or " . "       person.lastname       like lower('{$partialName}%') or " . "       {$fullNameSql} like lower('{$partialName}%')) ";
     return User::getSubset($joinTablesAdapter, null, $pageSize, $where, "person.firstname, person.lastname");
 }
開發者ID:youprofit,項目名稱:Zurmo,代碼行數:16,代碼來源:UserModelSearch.php

示例2: getModelsByFullName

 public static function getModelsByFullName($modelClassName, $fullName)
 {
     assert('is_string($modelClassName)');
     assert('is_subclass_of($modelClassName, "Person") && $modelClassName != "Person" ||' . '$modelClassName == "User"');
     assert('is_string($fullName)');
     $personTableName = RedBeanModel::getTableName('Person');
     $joinTablesAdapter = new RedBeanModelJoinTablesQueryAdapter($modelClassName);
     $joinTablesAdapter->addFromTableAndGetAliasName($personTableName, "{$personTableName}_id");
     $fullNameSql = DatabaseCompatibilityUtil::concat(array('person.firstname', '\' \'', 'person.lastname'));
     $where = "{$fullNameSql} = '{$fullName}'";
     return $modelClassName::getSubset($joinTablesAdapter, null, null, $where);
 }
開發者ID:sandeep1027,項目名稱:zurmo_,代碼行數:12,代碼來源:ZurmoModelSearch.php

示例3: testConcat

 public function testConcat()
 {
     $res = DatabaseCompatibilityUtil::concat(array('column1', 'column2'));
     $this->assertEquals('concat(column1, column2)', $res);
 }
開發者ID:youprofit,項目名稱:Zurmo,代碼行數:5,代碼來源:DatabaseCompatibilityUtilTest.php

示例4: 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

示例5: getWherePartForPartialNameSearchByPartialName

 protected static function getWherePartForPartialNameSearchByPartialName($partialName)
 {
     assert('is_string($partialName)');
     $fullNameSql = DatabaseCompatibilityUtil::concat(array('person.firstname', '\' \'', 'person.lastname'));
     return "      (person.firstname      like '{$partialName}%' or " . "       person.lastname       like '{$partialName}%' or " . "       {$fullNameSql} like '{$partialName}%') ";
 }
開發者ID:sandeep1027,項目名稱:zurmo_,代碼行數:6,代碼來源:ContactSearch.php

示例6: getWherePartForFullNameSearch

 /**
  * Gets where part for full name search
  * @param string $fullName
  * @return string
  */
 protected static function getWherePartForFullNameSearch($fullName)
 {
     assert('is_string($fullName)');
     static::sanitizeSearchTerm($fullName);
     $fullNameSql = DatabaseCompatibilityUtil::concat(array('person.firstname', '\' \'', 'person.lastname'));
     return "{$fullNameSql} = '{$fullName}'";
 }
開發者ID:maruthisivaprasad,項目名稱:zurmo,代碼行數:12,代碼來源:ContactSearch.php


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