/** {@inheritDoc} */ public function prepareQueryBeforeCount(xPDOQuery $c) { if ($this->getProperty('combo')) { $c->limit(0); $c->groupby('level'); } return $c; }
/** * Set parameters and prepare query * * @return PDOStatement */ public function prepareQuery() { if (!empty($this->config['limit'])) { $time = microtime(true); $this->query->limit($this->config['limit'], $this->config['offset']); $this->addTime('Limited to <b>' . $this->config['limit'] . '</b>, offset <b>' . $this->config['offset'] . '</b>', microtime(true) - $time); } return $this->query->prepare(); }
/** * Set parameters and prepare query * * @return PDOStatement */ public function prepareQuery() { if ($limit = (int) $this->config['limit']) { $offset = (int) $this->config['offset']; $time = microtime(true); $this->query->limit($limit, $offset); $this->addTime('Limited to <b>' . $limit . '</b>, offset <b>' . $offset . '</b>', microtime(true) - $time); } return $this->query->prepare(); }
/** {@inheritDoc} */ public function prepareQueryBeforeCount(xPDOQuery $c) { if ($this->getProperty('combo')) { $c->limit(0); $c->select('id,name'); } $query = $this->getProperty('query'); if (!empty($query)) { $c->where(array('name:LIKE' => '%' . $query . '%')); } return $c; }