Ejemplo n.º 1
0
 /**
  * Render LIMIT OFFSET clause
  *
  * @param string   $sql SQL query
  * @return string
  */
 protected function _renderLimitoffset($sql)
 {
     $count = 0;
     $offset = 0;
     if (!empty($this->_parts[self::LIMIT_OFFSET])) {
         $offset = (int) $this->_parts[self::LIMIT_OFFSET];
         $count = PHP_INT_MAX;
     }
     if (!empty($this->_parts[self::LIMIT_COUNT])) {
         $count = (int) $this->_parts[self::LIMIT_COUNT];
     }
     /*
      * Add limits clause
      */
     if ($count > 0) {
         $sql = trim($this->_adapter->limit($sql, $count, $offset));
     }
     return $sql;
 }