Пример #1
0
 /**
  * getList
  *
  * @param Query    $query
  * @param integer  $start
  * @param integer  $limit
  *
  * @return  \stdClass[]
  */
 public function getList(Query $query, $start = null, $limit = null)
 {
     $query->limit($start, $limit);
     if (WINDWALKER_DEBUG) {
         $profiler = Ioc::getProfiler();
         $profiler->mark(uniqid() . ' - ' . (string) $query->dump());
     }
     $select = $query->select;
     $select = str_replace('SELECT ', 'SQL_CALC_FOUND_ROWS ', $select);
     $query->clear('select')->select($select);
     return $this->db->getReader($query)->loadObjectList();
 }
Пример #2
0
 /**
  * Clear data from the query or a specific clause of the query.
  *
  * @param   string  $clause  Optionally, the name of the clause to clear, or nothing to clear the whole query.
  *
  * @return  PostgresqlQuery  Returns this object to allow chaining.
  *
  * @since   2.0
  */
 public function clear($clause = null)
 {
     switch ($clause) {
         case 'limit':
             $this->limit = null;
             break;
         case 'offset':
             $this->offset = null;
             break;
         case 'forUpdate':
             $this->forUpdate = null;
             break;
         case 'forShare':
             $this->forShare = null;
             break;
         case 'noWait':
             $this->noWait = null;
             break;
         case 'returning':
             $this->returning = null;
             break;
         case 'select':
         case 'update':
         case 'delete':
         case 'insert':
         case 'from':
         case 'join':
         case 'set':
         case 'where':
         case 'group':
         case 'having':
         case 'order':
         case 'columns':
         case 'values':
             parent::clear($clause);
             break;
         default:
             $this->type = null;
             $this->limit = null;
             $this->offset = null;
             $this->forUpdate = null;
             $this->forShare = null;
             $this->noWait = null;
             $this->returning = null;
             parent::clear($clause);
             break;
     }
     return $this;
 }
Пример #3
0
 /**
  * Clear data from the query or a specific clause of the query.
  *
  * @param   string  $clause  Optionally, the name of the clause to clear, or nothing to clear the whole query.
  *
  * @return  SqliteQuery  Returns this object to allow chaining.
  *
  * @since   2.0
  */
 public function clear($clause = null)
 {
     switch ($clause) {
         case null:
             $this->bounded = array();
             break;
     }
     return parent::clear($clause);
 }