public function update ($request, $match, $p)
    {
        // check collection
        if (isset($match['collectionId'])) {
            $collectionId = $match['collectionId'];
            $request->REQUEST['collection'] = $collectionId;
        } else {
            $collectionId = $request->REQUEST['collection'];
        }
        $collection = Pluf_Shortcuts_GetObjectOr404('Collection_Collection', 
                $collectionId);
        $document = Pluf_Shortcuts_GetObjectOr404('Collection_Document', 
                $match['modelId']);
        if ($document->collection !== $collection->id) {
            throw new Pluf_Exception_DoesNotExist(
                    'Document with id (' . $document->id .
                             ') does not exist in collection with id (' .
                             $collection->id . ')');
        }
        // update document
        $plufService = new Pluf_Views();
        return $plufService->updateObject($request, $match, $p);
    }
public function update ($request, $match, $p)
    {
        // check collection
        if (isset($match['collectionId'])) {
            $collectionId = $match['collectionId'];
            $request->REQUEST['collection'] = $collectionId;
        } else {
            $collectionId = $request->REQUEST['collection'];
        }
        $collection = Pluf_Shortcuts_GetObjectOr404('Collection_Collection', 
                $collectionId);
        $document = Pluf_Shortcuts_GetObjectOr404('Collection_Document', 
                $match['modelId']);
        if ($document->collection !== $collection->id) {
            throw new Pluf_Exception_DoesNotExist(
                    'Document with id (' . $document->id .
                             ') does not exist in collection with id (' .
                             $collection->id . ')');
        }
        // update document
        $plufService = new Pluf_Views();
        return $plufService->updateObject($request, $match, $p);
    }
public function update ( $ request , $ match , $ p ) { // check collection if ( isset ( $ match [ 'collectionId' ] ) ) { $ collectionId = $ match [ 'collectionId' ] ; $ request -> REQUEST [ 'collection' ] = $ collectionId ; } else { $ collectionId = $ request -> REQUEST [ 'collection' ] ; } $ collection = Pluf_Shortcuts_GetObjectOr404 ( 'Collection_Collection' , $ collectionId ) ; $ document = Pluf_Shortcuts_GetObjectOr404 ( 'Collection_Document' , $ match [ 'modelId' ] ) ; if ( $ document -> collection !== $ collection -> id ) { throw new Pluf_Exception_DoesNotExist ( 'Document with id (' . $ document -> id . ') does not exist in collection with id (' . $ collection -> id . ')' ) ; } // update document $ plufService = new Pluf_Views ( ) ; return $ plufService -> updateObject ( $ request , $ match , $ p ) ; }
Updates a document

@param Pluf_HTTP_Request $request
@param array $match
@param array $p
@throws Pluf_Exception_DoesNotExist
@return Pluf_HTTP_Response
Updates a document