本文整理匯總了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);
}
示例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);
}