public function find ($request, $match)
    {
        // check for collection
        if (isset($match['collectionId'])) {
            $collectionId = $match['collectionId'];
        } elseif (isset($request->REQUEST['collectionId'])) {
            $collectionId = $request->REQUEST['collectionId'];
        }
        
        $document = new Collection_Document();
        $paginator = new Pluf_Paginator($document);
        if (isset($collectionId)) {
            $sql = new Pluf_SQL('collection=%s', 
                    array(
                            $collectionId
                    ));
            $paginator->forced_where = $sql;
        }
        $paginator->list_filters = array(
                'id'
        );
        $search_fields = array(
                'id'
        );
        $sort_fields = array(
                'id',
                'collection'
        );
        $paginator->configure(array(), $search_fields, $sort_fields);
        $paginator->items_per_page = Collection_Shortcuts_NormalizeItemPerPage(
                $request);
        $paginator->setFromRequest($request);
        $docs = $paginator->render_object();
        // TODO: maso, 2017: pass list of attributes
        foreach ($docs['items'] as $key => $value) {
            $docs['items'][$key] = $this->getDocumentMap($value);
        }
        return new Pluf_HTTP_Response_Json($docs);
    }
public function find ($request, $match)
    {
        // check for collection
        if (isset($match['collectionId'])) {
            $collectionId = $match['collectionId'];
        } elseif (isset($request->REQUEST['collectionId'])) {
            $collectionId = $request->REQUEST['collectionId'];
        }
        
        $document = new Collection_Document();
        $paginator = new Pluf_Paginator($document);
        if (isset($collectionId)) {
            $sql = new Pluf_SQL('collection=%s', 
                    array(
                            $collectionId
                    ));
            $paginator->forced_where = $sql;
        }
        $paginator->list_filters = array(
                'id'
        );
        $search_fields = array(
                'id'
        );
        $sort_fields = array(
                'id',
                'collection'
        );
        $paginator->configure(array(), $search_fields, $sort_fields);
        $paginator->items_per_page = Collection_Shortcuts_NormalizeItemPerPage(
                $request);
        $paginator->setFromRequest($request);
        $docs = $paginator->render_object();
        // TODO: maso, 2017: pass list of attributes
        foreach ($docs['items'] as $key => $value) {
            $docs['items'][$key] = $this->getDocumentMap($value);
        }
        return new Pluf_HTTP_Response_Json($docs);
    }
public function find ( $ request , $ match ) { // check for collection if ( isset ( $ match [ 'collectionId' ] ) ) { $ collectionId = $ match [ 'collectionId' ] ; } elseif ( isset ( $ request -> REQUEST [ 'collectionId' ] ) ) { $ collectionId = $ request -> REQUEST [ 'collectionId' ] ; } $ document = new Collection_Document ( ) ; $ paginator = new Pluf_Paginator ( $ document ) ; if ( isset ( $ collectionId ) ) { $ sql = new Pluf_SQL ( 'collection=%s' , array ( $ collectionId ) ) ; $ paginator -> forced_where = $ sql ; } $ paginator -> list_filters = array ( 'id' ) ; $ search_fields = array ( 'id' ) ; $ sort_fields = array ( 'id' , 'collection' ) ; $ paginator -> configure ( array ( ) , $ search_fields , $ sort_fields ) ; $ paginator -> items_per_page = Collection_Shortcuts_NormalizeItemPerPage ( $ request ) ; $ paginator -> setFromRequest ( $ request ) ; $ docs = $ paginator -> render_object ( ) ; // TODO: maso, 2017: pass list of attributes foreach ( $ docs [ 'items' ] as $ key => $ value ) { $ docs [ 'items' ] [ $ key ] = $ this -> getDocumentMap ( $ value ) ; } return new Pluf_HTTP_Response_Json ( $ docs ) ; }
Search for an document

@param Pluf_HTTP_Request $request
@param array $match
@return Pluf_HTTP_Response_Json
Search for an document