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


PHP Store::buildQuery方法代碼示例

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


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

示例1: buildQuery

 protected function buildQuery(&$qlist, &$tables, &$query)
 {
     if (!isset($tables['weaver_core'])) {
         $tables['weaver_core'] = 'weaver_core';
     }
     if (!isset($tables['weaver_storyref'])) {
         $tables['weaver_storyref'] = array('name' => 'weaver_storyref', 'clause' => '"weaver_storyref"."story" = "obj"."uuid"');
     }
     foreach ($query as $k => $v) {
         $value = $v;
         switch ($k) {
             case 'parent':
                 unset($query[$k]);
                 if ($v === null) {
                     $qlist['weaver_core'][] = '"weaver_core"."parent" IS NULL';
                 } else {
                     $qlist['weaver_core'][] = '"weaver_core"."parent" = ' . $this->db->quote($v);
                 }
                 break;
             case 'universe':
                 unset($query[$k]);
                 if ($v === null) {
                     $qlist['weaver_core'][] = '"weaver_core"."universe" IS NULL';
                 } else {
                     $qlist['weaver_core'][] = '"weaver_core"."universe" = ' . $this->db->quote($v);
                 }
                 break;
             case 'title_firstchar':
                 unset($query[$k]);
                 $qlist['weaver_core'][] = '"weaver_core"."title_firstchar" = ' . $this->db->quote($v);
                 break;
             case 'thing':
                 unset($query[$k]);
                 $qlist['weaver_storyref'][] = '"weaver_storyref"."thing" = ' . $this->db->quote($v);
                 break;
         }
     }
     return parent::buildQuery($qlist, $tables, $query);
 }
開發者ID:nexgenta,項目名稱:weaver,代碼行數:39,代碼來源:model.php

示例2: buildQuery

 protected function buildQuery(&$qlist, &$tables, &$query)
 {
     if (!isset($tables['media_core'])) {
         $tables['media_core'] = 'media_core';
     }
     foreach ($query as $k => $v) {
         $value = $v;
         switch ($k) {
             case 'parent':
                 unset($query[$k]);
                 if ($v === null) {
                     $qlist['media_core'][] = '"media_core"."parent" IS NULL';
                 } else {
                     $qlist['media_core'][] = '"media_core"."parent" = ' . $this->db->quote($v);
                 }
                 break;
             case 'title_firstchar':
                 unset($query[$k]);
                 $qlist['media_core'][] = '"media_core"."title_firstchar" = ' . $this->db->quote($v);
                 break;
         }
     }
     return parent::buildQuery($qlist, $tables, $query);
 }
開發者ID:nexgenta,項目名稱:media,代碼行數:24,代碼來源:model.php


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