public function get($documentId, $cache = true)
    {
        $rtn = $this->getCache($documentId);

        if (!$cache || !$rtn) {
            list($status, $doc) = $this->sendRequest(urlencode($documentId));

            if ($status == 200) {
                $rtn = $this->setCache($documentId, $doc);
            } else {
                $rtn = null;
            }
        }

        return $this->asDocs ? $this->toDocument($rtn) : $rtn;
    }
public function get($documentId, $cache = true)
    {
        $rtn = $this->getCache($documentId);

        if (!$cache || !$rtn) {
            list($status, $doc) = $this->sendRequest(urlencode($documentId));

            if ($status == 200) {
                $rtn = $this->setCache($documentId, $doc);
            } else {
                $rtn = null;
            }
        }

        return $this->asDocs ? $this->toDocument($rtn) : $rtn;
    }
public function get ( $ documentId , $ cache = true ) { $ rtn = $ this -> getCache ( $ documentId ) ; if ( ! $ cache || ! $ rtn ) { list ( $ status , $ doc ) = $ this -> sendRequest ( urlencode ( $ documentId ) ) ; if ( $ status == 200 ) { $ rtn = $ this -> setCache ( $ documentId , $ doc ) ; } else { $ rtn = null ; } } return $ this -> asDocs ? $ this -> toDocument ( $ rtn ) : $ rtn ; }
Get document by ID, optionally pull from cache if previously queried.

@param string $documentId Document ID.
@param bool $cache Whether or not to use the cache.
@link http://wiki.apache.org/couchdb/HTTP_Document_API#GET
@return \Chill\Document[]|array
Get document by ID optionally pull from cache if previously queried .