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); }
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); }