public function create ($request, $match, $p)
    {
        // check collection
        if (isset($match['collectionId'])) {
            $collectionId = $match['collectionId'];
            $request->REQUEST['collection'] = $collectionId;
        } else {
            $collectionId = $request->REQUEST['collection'];
        }
        Pluf_Shortcuts_GetObjectOr404('Collection_Collection', $collectionId);
        // create document
        $object = new Collection_Document();
        $form = Pluf_Shortcuts_GetFormForModel($object, $request->REQUEST, array());
        $object = $form->save();
        $this->putDocumentMap($object, $request->REQUEST);
        return new Pluf_HTTP_Response_Json($this->getDocumentMap($object));
    }
public function create ($request, $match, $p)
    {
        // check collection
        if (isset($match['collectionId'])) {
            $collectionId = $match['collectionId'];
            $request->REQUEST['collection'] = $collectionId;
        } else {
            $collectionId = $request->REQUEST['collection'];
        }
        Pluf_Shortcuts_GetObjectOr404('Collection_Collection', $collectionId);
        // create document
        $object = new Collection_Document();
        $form = Pluf_Shortcuts_GetFormForModel($object, $request->REQUEST, array());
        $object = $form->save();
        $this->putDocumentMap($object, $request->REQUEST);
        return new Pluf_HTTP_Response_Json($this->getDocumentMap($object));
    }
public function create ( $ request , $ match , $ p ) { // check collection if ( isset ( $ match [ 'collectionId' ] ) ) { $ collectionId = $ match [ 'collectionId' ] ; $ request -> REQUEST [ 'collection' ] = $ collectionId ; } else { $ collectionId = $ request -> REQUEST [ 'collection' ] ; } Pluf_Shortcuts_GetObjectOr404 ( 'Collection_Collection' , $ collectionId ) ; // create document $ object = new Collection_Document ( ) ; $ form = Pluf_Shortcuts_GetFormForModel ( $ object , $ request -> REQUEST , array ( ) ) ; $ object = $ form -> save ( ) ; $ this -> putDocumentMap ( $ object , $ request -> REQUEST ) ; return new Pluf_HTTP_Response_Json ( $ this -> getDocumentMap ( $ object ) ) ; }
Creates new instance of a document

@param Pluf_HTTP_Request $request
@param array $match
@param array $p
@return Pluf_HTTP_Response
Creates new instance of a document