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


PHP Query::innerJoinWith方法代碼示例

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


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

示例1: search

 /**
  * {@inheritDoc}
  *
  * It looks for search-criteria and applies them over the query object. For
  * example, given the criteria below:
  *
  *     "this phrase" -"and not this one"
  *
  * Alters the query object as follow:
  *
  * ```php
  * $query->where([
  *    'indexed_words LIKE' => '%this phrase%',
  *    'indexed_words NOT LIKE' => '%and not this one%'
  * ]);
  * ```
  *
  * The `AND` & `OR` keywords are allowed to create complex conditions. For
  * example:
  *
  *     "this phrase" OR -"and not this one" AND "this"
  *
  * Will produce something like:
  *
  * ```php
  * $query->where(['indexed_words LIKE' => '%this phrase%'])
  *     ->orWhere(['indexed_words NOT LIKE' => '%and not this one%']);
  *     ->andWhere(['indexed_words LIKE' => '%this%']);
  * ```
  */
 public function search($criteria, Query $query)
 {
     $tokens = (array) (new MiniLanguageParser($criteria))->parse();
     if (!empty($tokens)) {
         $query->innerJoinWith('SearchDatasets');
         foreach ($tokens as $token) {
             if ($token->isOperator()) {
                 $query = $this->_scopeOperator($query, $token);
             } else {
                 $query = $this->_scopeWords($query, $token);
             }
         }
     }
     return $query;
 }
開發者ID:quickapps-plugins,項目名稱:search,代碼行數:45,代碼來源:GenericEngine.php


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