public function getAllDocs($incDocs = false, $limit = null, $startKey = null, $endKey = null, $keys = null, $descending = false, $skip = 0) {
    if(!$this->db) {
      throw new SagException('No database specified.');
    }

    $qry = array();

    if($incDocs !== false) {
      if(!is_bool($incDocs)) {
        throw new SagException('getAllDocs() expected a boolean for include_docs.');
      }

      $qry[] = "include_docs=true";
    }

    if(isset($startKey)) {
      if(!is_string($startKey)) {
        throw new SagException('getAllDocs() expected a string for startkey.');
      }

      $qry[] = 'startkey='.urlencode($startKey);
    }

    if(isset($endKey)) {
      if(!is_string($endKey)) {
        throw new SagException('getAllDocs() expected a string for endkey.');
      }

      $qry[] = 'endkey='.urlencode($endKey);
    }

    if(isset($limit)) {
      if(!is_int($limit) || $limit < 0) {
        throw new SagException('getAllDocs() expected a positive integeter for limit.');
      }

      $qry[] = 'limit='.urlencode($limit);
    }

    if($descending !== false) {
      if(!is_bool($descending)) {
        throw new SagException('getAllDocs() expected a boolean for descending.');
      }

      $qry[] = "descending=true";
    }

    if(isset($skip)) {
      if(!is_int($skip) || $skip < 0) {
        throw new SagException('getAllDocs() expected a non-negative integer for skip');
      }

      $qry[] = 'skip=' . urlencode($skip);
    }

    $qry = '?'.implode('&', $qry);

    if(isset($keys))
    {
      if(!is_array($keys)) {
        throw new SagException('getAllDocs() expected an array for the keys.');
      }

      $data = new stdClass();
      $data->keys = $keys;

      return $this->procPacket('POST', "/{$this->db}/_all_docs$qry", json_encode($data));
    }

    return $this->procPacket('GET', "/{$this->db}/_all_docs$qry");
  }
public function getAllDocs($incDocs = false, $limit = null, $startKey = null, $endKey = null, $keys = null, $descending = false, $skip = 0) {
    if(!$this->db) {
      throw new SagException('No database specified.');
    }

    $qry = array();

    if($incDocs !== false) {
      if(!is_bool($incDocs)) {
        throw new SagException('getAllDocs() expected a boolean for include_docs.');
      }

      $qry[] = "include_docs=true";
    }

    if(isset($startKey)) {
      if(!is_string($startKey)) {
        throw new SagException('getAllDocs() expected a string for startkey.');
      }

      $qry[] = 'startkey='.urlencode($startKey);
    }

    if(isset($endKey)) {
      if(!is_string($endKey)) {
        throw new SagException('getAllDocs() expected a string for endkey.');
      }

      $qry[] = 'endkey='.urlencode($endKey);
    }

    if(isset($limit)) {
      if(!is_int($limit) || $limit < 0) {
        throw new SagException('getAllDocs() expected a positive integeter for limit.');
      }

      $qry[] = 'limit='.urlencode($limit);
    }

    if($descending !== false) {
      if(!is_bool($descending)) {
        throw new SagException('getAllDocs() expected a boolean for descending.');
      }

      $qry[] = "descending=true";
    }

    if(isset($skip)) {
      if(!is_int($skip) || $skip < 0) {
        throw new SagException('getAllDocs() expected a non-negative integer for skip');
      }

      $qry[] = 'skip=' . urlencode($skip);
    }

    $qry = '?'.implode('&', $qry);

    if(isset($keys))
    {
      if(!is_array($keys)) {
        throw new SagException('getAllDocs() expected an array for the keys.');
      }

      $data = new stdClass();
      $data->keys = $keys;

      return $this->procPacket('POST', "/{$this->db}/_all_docs$qry", json_encode($data));
    }

    return $this->procPacket('GET', "/{$this->db}/_all_docs$qry");
  }
public function getAllDocs ( $ incDocs = false , $ limit = null , $ startKey = null , $ endKey = null , $ keys = null , $ descending = false , $ skip = 0 ) { if ( ! $ this -> db ) { throw new SagException ( 'No database specified.' ) ; } $ qry = array ( ) ; if ( $ incDocs !== false ) { if ( ! is_bool ( $ incDocs ) ) { throw new SagException ( 'getAllDocs() expected a boolean for include_docs.' ) ; } $ qry [ ] = "include_docs=true" ; } if ( isset ( $ startKey ) ) { if ( ! is_string ( $ startKey ) ) { throw new SagException ( 'getAllDocs() expected a string for startkey.' ) ; } $ qry [ ] = 'startkey=' . urlencode ( $ startKey ) ; } if ( isset ( $ endKey ) ) { if ( ! is_string ( $ endKey ) ) { throw new SagException ( 'getAllDocs() expected a string for endkey.' ) ; } $ qry [ ] = 'endkey=' . urlencode ( $ endKey ) ; } if ( isset ( $ limit ) ) { if ( ! is_int ( $ limit ) || $ limit < 0 ) { throw new SagException ( 'getAllDocs() expected a positive integeter for limit.' ) ; } $ qry [ ] = 'limit=' . urlencode ( $ limit ) ; } if ( $ descending !== false ) { if ( ! is_bool ( $ descending ) ) { throw new SagException ( 'getAllDocs() expected a boolean for descending.' ) ; } $ qry [ ] = "descending=true" ; } if ( isset ( $ skip ) ) { if ( ! is_int ( $ skip ) || $ skip < 0 ) { throw new SagException ( 'getAllDocs() expected a non-negative integer for skip' ) ; } $ qry [ ] = 'skip=' . urlencode ( $ skip ) ; } $ qry = '?' . implode ( '&' , $ qry ) ; if ( isset ( $ keys ) ) { if ( ! is_array ( $ keys ) ) { throw new SagException ( 'getAllDocs() expected an array for the keys.' ) ; } $ data = new stdClass ( ) ; $ data -> keys = $ keys ; return $ this -> procPacket ( 'POST' , "/{$this->db}/_all_docs$qry" , json_encode ( $ data ) ) ; } return $ this -> procPacket ( 'GET' , "/{$this->db}/_all_docs$qry" ) ; }
Gets all the documents in the database with _all_docs. Its results will
not be cached by SagCache.

@param bool $incDocs Whether to include the documents or not. Defaults to
false.
@param int $limit Limits the number of documents to return. Must be >= 0,
or null for no limit. Defaults to null (no limit).
@param string $startKey The startkey variable (valid JSON). Defaults to
null.
@param string $endKey The endkey variable (valid JSON). Defaults to null.
@param array $keys An array of keys (strings) of the specific documents
you're trying to get.
@param bool $descending Whether to sort the results in descending order or
not.
@param int $skip Skip this number of records before starting to return the
results. Defaults to 0.

@return mixed
Gets all the documents in the database with _all_docs . Its results will not be cached by SagCache .