public function get ($request, $match)
    {
        if (isset($match['collectionId'])) {
            $collectionId = $match['collectionId'];
        } else {
            $collectionId = $request->REQUEST['collectionId'];
        }
        $collection = Pluf_Shortcuts_GetObjectOr404('Collection_Collection', 
                $collectionId);
        $document = Pluf_Shortcuts_GetObjectOr404('Collection_Document', 
                $match['documentId']);
        if ($document->collection !== $collection->id) {
            throw new Pluf_Exception_DoesNotExist(
                    'Document with id (' . $document->id .
                             ') does not exist in collection with id (' .
                             $collection->id . ')');
        }
        return new Pluf_HTTP_Response_Json($document);
    }
public function get ($request, $match)
    {
        if (isset($match['collectionId'])) {
            $collectionId = $match['collectionId'];
        } else {
            $collectionId = $request->REQUEST['collectionId'];
        }
        $collection = Pluf_Shortcuts_GetObjectOr404('Collection_Collection', 
                $collectionId);
        $document = Pluf_Shortcuts_GetObjectOr404('Collection_Document', 
                $match['documentId']);
        if ($document->collection !== $collection->id) {
            throw new Pluf_Exception_DoesNotExist(
                    'Document with id (' . $document->id .
                             ') does not exist in collection with id (' .
                             $collection->id . ')');
        }
        return new Pluf_HTTP_Response_Json($document);
    }
public function get ( $ request , $ match ) { if ( isset ( $ match [ 'collectionId' ] ) ) { $ collectionId = $ match [ 'collectionId' ] ; } else { $ collectionId = $ request -> REQUEST [ 'collectionId' ] ; } $ collection = Pluf_Shortcuts_GetObjectOr404 ( 'Collection_Collection' , $ collectionId ) ; $ document = Pluf_Shortcuts_GetObjectOr404 ( 'Collection_Document' , $ match [ 'documentId' ] ) ; if ( $ document -> collection !== $ collection -> id ) { throw new Pluf_Exception_DoesNotExist ( 'Document with id (' . $ document -> id . ') does not exist in collection with id (' . $ collection -> id . ')' ) ; } return new Pluf_HTTP_Response_Json ( $ document ) ; }
Gets a document

@param Pluf_HTTP_Request $request
@param array $match
@throws Pluf_Exception_DoesNotExist
@return Pluf_HTTP_Response_Json
Gets a document