server/src/app/Http/Controllers/Api/DocumentController.php
author ymh <ymh.work@gmail.com>
Wed, 19 Oct 2016 15:55:04 +0200
changeset 370 d7c5b43d309a
parent 369 796725d33b67
child 372 796ebdbf6a25
permissions -rw-r--r--
add theme/subject filter to back documents api end point
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
<?php
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
namespace CorpusParole\Http\Controllers\Api;
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
use Illuminate\Http\Request;
28
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
     6
//use Illuminate\Http\Response;
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
use CorpusParole\Http\Requests;
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
use CorpusParole\Http\Controllers\Controller;
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
use CorpusParole\Repositories\DocumentRepository;
163
59c68fc4848e Add transcript api endpoint
ymh <ymh.work@gmail.com>
parents: 138
diff changeset
    11
use CorpusParole\Services\TranscriptManager;
329
0a2c2ad49d75 Improvce language visualization. Generalize language node selection, change language query parameters, add resolution of node name (corpus-) to lexvo controler
ymh <ymh.work@gmail.com>
parents: 326
diff changeset
    12
use CorpusParole\Libraries\Filters\CorpusFilterManager;
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
class DocumentController extends Controller
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
{
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
    /**
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
     * Create a new controller instance.
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
     */
163
59c68fc4848e Add transcript api endpoint
ymh <ymh.work@gmail.com>
parents: 138
diff changeset
    19
    public function __construct(DocumentRepository $documentRepo, TranscriptManager $transcriptManager) {
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
        $this->documentRepository = $documentRepo;
163
59c68fc4848e Add transcript api endpoint
ymh <ymh.work@gmail.com>
parents: 138
diff changeset
    21
        $this->transcriptManager = $transcriptManager;
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
    }
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
    /**
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
     * Display a listing of the resource.
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
     *
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
     * @return Response
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    28
     */
324
92fc9d077f95 add pagination info for document list, move it to meta sub object
ymh <ymh.work@gmail.com>
parents: 319
diff changeset
    29
    public function index(Request $request)
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    30
    {
324
92fc9d077f95 add pagination info for document list, move it to meta sub object
ymh <ymh.work@gmail.com>
parents: 319
diff changeset
    31
        $perPage = intval($request->input('perpage', config('corpusparole.documents_per_page')));
326
226d5b17a119 - First implementation of filter for languages.
ymh <ymh.work@gmail.com>
parents: 324
diff changeset
    32
226d5b17a119 - First implementation of filter for languages.
ymh <ymh.work@gmail.com>
parents: 324
diff changeset
    33
        $filters = [];
369
796725d33b67 Add location filter to documents api end-point
ymh <ymh.work@gmail.com>
parents: 329
diff changeset
    34
796725d33b67 Add location filter to documents api end-point
ymh <ymh.work@gmail.com>
parents: 329
diff changeset
    35
        $languages = CorpusFilterManager::prepareLanguages($request->input('language', []));
326
226d5b17a119 - First implementation of filter for languages.
ymh <ymh.work@gmail.com>
parents: 324
diff changeset
    36
        if(!empty($languages)) {
369
796725d33b67 Add location filter to documents api end-point
ymh <ymh.work@gmail.com>
parents: 329
diff changeset
    37
            $filters['language'] = $languages;
326
226d5b17a119 - First implementation of filter for languages.
ymh <ymh.work@gmail.com>
parents: 324
diff changeset
    38
        }
369
796725d33b67 Add location filter to documents api end-point
ymh <ymh.work@gmail.com>
parents: 329
diff changeset
    39
        $location = CorpusFilterManager::prepareLocation($request->input('location', ''));
796725d33b67 Add location filter to documents api end-point
ymh <ymh.work@gmail.com>
parents: 329
diff changeset
    40
        if(!empty($location)) {
796725d33b67 Add location filter to documents api end-point
ymh <ymh.work@gmail.com>
parents: 329
diff changeset
    41
            $filters['location'] = $location;
796725d33b67 Add location filter to documents api end-point
ymh <ymh.work@gmail.com>
parents: 329
diff changeset
    42
        }
370
d7c5b43d309a add theme/subject filter to back documents api end point
ymh <ymh.work@gmail.com>
parents: 369
diff changeset
    43
        $themes = CorpusFilterManager::prepareTheme($request->input('theme', []));
d7c5b43d309a add theme/subject filter to back documents api end point
ymh <ymh.work@gmail.com>
parents: 369
diff changeset
    44
        if(!empty($themes)) {
d7c5b43d309a add theme/subject filter to back documents api end point
ymh <ymh.work@gmail.com>
parents: 369
diff changeset
    45
            $filters['themes'] = $themes;
d7c5b43d309a add theme/subject filter to back documents api end point
ymh <ymh.work@gmail.com>
parents: 369
diff changeset
    46
        }
369
796725d33b67 Add location filter to documents api end-point
ymh <ymh.work@gmail.com>
parents: 329
diff changeset
    47
326
226d5b17a119 - First implementation of filter for languages.
ymh <ymh.work@gmail.com>
parents: 324
diff changeset
    48
        $sort = $request->input('sort', null);
226d5b17a119 - First implementation of filter for languages.
ymh <ymh.work@gmail.com>
parents: 324
diff changeset
    49
226d5b17a119 - First implementation of filter for languages.
ymh <ymh.work@gmail.com>
parents: 324
diff changeset
    50
        $paginator = $this->documentRepository->paginate($filters, $perPage, config('corpusparole.pagination_page_param'), null, $sort);
226d5b17a119 - First implementation of filter for languages.
ymh <ymh.work@gmail.com>
parents: 324
diff changeset
    51
125
e550b10fe3ca add language resolver on api data
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    52
        $res = $paginator->toArray();
e550b10fe3ca add language resolver on api data
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    53
        if(array_key_exists('data', $res)) {
e550b10fe3ca add language resolver on api data
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    54
            $documents = $res['data'];
e550b10fe3ca add language resolver on api data
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    55
            unset($res['data']);
324
92fc9d077f95 add pagination info for document list, move it to meta sub object
ymh <ymh.work@gmail.com>
parents: 319
diff changeset
    56
        } else {
92fc9d077f95 add pagination info for document list, move it to meta sub object
ymh <ymh.work@gmail.com>
parents: 319
diff changeset
    57
            $documents = [];
20
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    58
        }
324
92fc9d077f95 add pagination info for document list, move it to meta sub object
ymh <ymh.work@gmail.com>
parents: 319
diff changeset
    59
        return response()->json([ 'documents' => $documents, 'meta' => $res]);
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    60
    }
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    61
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    62
    /**
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    63
     * Show the form for creating a new resource.
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    64
     *
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    65
     * @return Response
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    66
     */
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    67
    public function create()
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    68
    {
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    69
        //
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    70
    }
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    71
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    72
    /**
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    73
     * Store a newly created resource in storage.
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    74
     *
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    75
     * @param  Request  $request
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    76
     * @return Response
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    77
     */
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    78
    public function store(Request $request)
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    79
    {
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    80
        //
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    81
    }
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    82
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    83
    /**
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    84
     * Display the specified resource.
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    85
     *
163
59c68fc4848e Add transcript api endpoint
ymh <ymh.work@gmail.com>
parents: 138
diff changeset
    86
     * @param  string  $id
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    87
     * @return Response
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    88
     */
168
17f10b56c079 improve document model and propagate changes. This include the change of document fixtures to better reflect what the api is effectively returning
ymh <ymh.work@gmail.com>
parents: 165
diff changeset
    89
    public function show(Request $request, $id)
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    90
    {
319
78990a8a069b Work on front and back integration, correct the expected data format
ymh <ymh.work@gmail.com>
parents: 304
diff changeset
    91
        $id = urldecode($id);
168
17f10b56c079 improve document model and propagate changes. This include the change of document fixtures to better reflect what the api is effectively returning
ymh <ymh.work@gmail.com>
parents: 165
diff changeset
    92
        $short = filter_var($request->input('short', false), FILTER_VALIDATE_BOOLEAN);
17f10b56c079 improve document model and propagate changes. This include the change of document fixtures to better reflect what the api is effectively returning
ymh <ymh.work@gmail.com>
parents: 165
diff changeset
    93
        $doc = $this->documentRepository->get($id, $short);
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    94
        if(is_null($doc)) {
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    95
            abort(404);
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    96
        }
128
bc18286e55b2 remove resolve lexvo on server in the api
ymh <ymh.work@gmail.com>
parents: 125
diff changeset
    97
        //$this->documentRepository->resolveLexvo([$doc,]);
20
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    98
        return response()->json(["document" => $doc]);
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    99
    }
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   100
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   101
    /**
163
59c68fc4848e Add transcript api endpoint
ymh <ymh.work@gmail.com>
parents: 138
diff changeset
   102
     * Display the resource transcript
59c68fc4848e Add transcript api endpoint
ymh <ymh.work@gmail.com>
parents: 138
diff changeset
   103
     *
59c68fc4848e Add transcript api endpoint
ymh <ymh.work@gmail.com>
parents: 138
diff changeset
   104
     * @param string $id
59c68fc4848e Add transcript api endpoint
ymh <ymh.work@gmail.com>
parents: 138
diff changeset
   105
     * @return Response
59c68fc4848e Add transcript api endpoint
ymh <ymh.work@gmail.com>
parents: 138
diff changeset
   106
     */
59c68fc4848e Add transcript api endpoint
ymh <ymh.work@gmail.com>
parents: 138
diff changeset
   107
    public function transcript($id) {
304
20071981ba2a add location and geonames resolvers and api
ymh <ymh.work@gmail.com>
parents: 277
diff changeset
   108
        $id= urldecode($id);
20071981ba2a add location and geonames resolvers and api
ymh <ymh.work@gmail.com>
parents: 277
diff changeset
   109
163
59c68fc4848e Add transcript api endpoint
ymh <ymh.work@gmail.com>
parents: 138
diff changeset
   110
        $doc = $this->documentRepository->get($id);
59c68fc4848e Add transcript api endpoint
ymh <ymh.work@gmail.com>
parents: 138
diff changeset
   111
        if(is_null($doc) || is_null($doc->getTranscript()) ) {
59c68fc4848e Add transcript api endpoint
ymh <ymh.work@gmail.com>
parents: 138
diff changeset
   112
            abort(404);
59c68fc4848e Add transcript api endpoint
ymh <ymh.work@gmail.com>
parents: 138
diff changeset
   113
        }
168
17f10b56c079 improve document model and propagate changes. This include the change of document fixtures to better reflect what the api is effectively returning
ymh <ymh.work@gmail.com>
parents: 165
diff changeset
   114
        $transcript = $doc->getTranscript();
17f10b56c079 improve document model and propagate changes. This include the change of document fixtures to better reflect what the api is effectively returning
ymh <ymh.work@gmail.com>
parents: 165
diff changeset
   115
        $transcriptUrl = $transcript->getUrl();
17f10b56c079 improve document model and propagate changes. This include the change of document fixtures to better reflect what the api is effectively returning
ymh <ymh.work@gmail.com>
parents: 165
diff changeset
   116
        if(empty($transcriptUrl) || empty($transcript->getConformsTo())) {
163
59c68fc4848e Add transcript api endpoint
ymh <ymh.work@gmail.com>
parents: 138
diff changeset
   117
            abort(404);
59c68fc4848e Add transcript api endpoint
ymh <ymh.work@gmail.com>
parents: 138
diff changeset
   118
        }
168
17f10b56c079 improve document model and propagate changes. This include the change of document fixtures to better reflect what the api is effectively returning
ymh <ymh.work@gmail.com>
parents: 165
diff changeset
   119
        $converter = $this->transcriptManager->getConverterUrl($transcript->getConformsTo(), $doc, $transcriptUrl);
163
59c68fc4848e Add transcript api endpoint
ymh <ymh.work@gmail.com>
parents: 138
diff changeset
   120
        return response()->json($converter->convertToJson());
59c68fc4848e Add transcript api endpoint
ymh <ymh.work@gmail.com>
parents: 138
diff changeset
   121
59c68fc4848e Add transcript api endpoint
ymh <ymh.work@gmail.com>
parents: 138
diff changeset
   122
    }
59c68fc4848e Add transcript api endpoint
ymh <ymh.work@gmail.com>
parents: 138
diff changeset
   123
59c68fc4848e Add transcript api endpoint
ymh <ymh.work@gmail.com>
parents: 138
diff changeset
   124
    /**
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   125
     * Show the form for editing the specified resource.
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   126
     *
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   127
     * @param  int  $id
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   128
     * @return Response
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   129
     */
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   130
    public function edit($id)
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   131
    {
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   132
        //
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   133
    }
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   134
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   135
    /**
28
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
   136
     * Update the specified document in storage.
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   137
     *
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   138
     * @param  Request  $request
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   139
     * @param  int  $id
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   140
     * @return Response
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   141
     */
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   142
    public function update(Request $request, $id)
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   143
    {
304
20071981ba2a add location and geonames resolvers and api
ymh <ymh.work@gmail.com>
parents: 277
diff changeset
   144
        $id= urldecode($id);
20071981ba2a add location and geonames resolvers and api
ymh <ymh.work@gmail.com>
parents: 277
diff changeset
   145
28
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
   146
        $data = $request->json();
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
   147
        $document = $data->get('document');
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
   148
        $doc = $this->documentRepository->get($id);
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
   149
        if(is_null($doc)) {
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
   150
            abort(404);
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
   151
        }
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
   152
138
3079cbf80006 add subjects save + set modified date when saing document in rest api
ymh <ymh.work@gmail.com>
parents: 130
diff changeset
   153
        //for now, update contributors and subjects only
28
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
   154
        $doc->setContributors($document['contributors']);
138
3079cbf80006 add subjects save + set modified date when saing document in rest api
ymh <ymh.work@gmail.com>
parents: 130
diff changeset
   155
        $doc->setSubjects($document['subjects']);
277
bd4bc1db4f40 add blank node save and geoinfo to back model
ymh <ymh.work@gmail.com>
parents: 168
diff changeset
   156
        $doc->addGeoInfo()->setRefLocs($document['reflocs']);
bd4bc1db4f40 add blank node save and geoinfo to back model
ymh <ymh.work@gmail.com>
parents: 168
diff changeset
   157
        $doc->getGeoInfo()->commit();
138
3079cbf80006 add subjects save + set modified date when saing document in rest api
ymh <ymh.work@gmail.com>
parents: 130
diff changeset
   158
3079cbf80006 add subjects save + set modified date when saing document in rest api
ymh <ymh.work@gmail.com>
parents: 130
diff changeset
   159
        $doc->setModified();
28
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
   160
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
   161
        $this->documentRepository->save($doc);
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
   162
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
   163
        return response('', 204);
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   164
    }
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   165
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   166
    /**
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   167
     * Remove the specified resource from storage.
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   168
     *
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   169
     * @param  int  $id
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   170
     * @return Response
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   171
     */
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   172
    public function destroy($id)
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   173
    {
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   174
        //
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   175
    }
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
   176
}