本文整理汇总了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);
}