Beispiel #1
0
 /** {@inheritDoc} */
 public function prepareQueryBeforeCount(xPDOQuery $c)
 {
     if ($this->getProperty('combo')) {
         $c->limit(0);
         $c->groupby('level');
     }
     return $c;
 }
Beispiel #2
0
 /**
  * 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();
 }
Beispiel #3
0
 /**
  * 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();
 }
Beispiel #4
0
 /** {@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;
 }