public function getView($design, $view, $key = null, $params = array())
    {
        $query = $this->processViewParameters($params);

        $url = '_design/' . $design . '/_view/' . $view . '?' . implode('&', $query);

        if (is_array($key)) {
            $rtn = $this->getViewByPost($url, $key);
        } else {
            if (!is_null($key)) {
                if (is_string($key)) {
                    $key = '"' . $key . '"';
                }

                if (is_bool($key)) {
                    $key = $key ? 'true' : 'false';
                }

                $url .= '&key=' . $key;
            }

            $rtn = $this->getViewByGet($url);
        }

        return $rtn;
    }
public function getView($design, $view, $key = null, $params = array())
    {
        $query = $this->processViewParameters($params);

        $url = '_design/' . $design . '/_view/' . $view . '?' . implode('&', $query);

        if (is_array($key)) {
            $rtn = $this->getViewByPost($url, $key);
        } else {
            if (!is_null($key)) {
                if (is_string($key)) {
                    $key = '"' . $key . '"';
                }

                if (is_bool($key)) {
                    $key = $key ? 'true' : 'false';
                }

                $url .= '&key=' . $key;
            }

            $rtn = $this->getViewByGet($url);
        }

        return $rtn;
    }
public function getView ( $ design , $ view , $ key = null , $ params = array ( ) ) { $ query = $ this -> processViewParameters ( $ params ) ; $ url = '_design/' . $ design . '/_view/' . $ view . '?' . implode ( '&' , $ query ) ; if ( is_array ( $ key ) ) { $ rtn = $ this -> getViewByPost ( $ url , $ key ) ; } else { if ( ! is_null ( $ key ) ) { if ( is_string ( $ key ) ) { $ key = '"' . $ key . '"' ; } if ( is_bool ( $ key ) ) { $ key = $ key ? 'true' : 'false' ; } $ url .= '&key=' . $ key ; } $ rtn = $ this -> getViewByGet ( $ url ) ; } return $ rtn ; }
Get the results of a CouchDb view as an array of arrays, or Chill Document objects.

@param string $design Design name.
@param string $view View name.
@param mixed $key (Optional) String key, or array of keys, to pass to the view.
@param array $params (Optional) Array of query string parameters to pass to the view.
@return \Chill\Document[]|array
Get the results of a CouchDb view as an array of arrays or Chill Document objects .