server/src/app/Repositories/DocumentRepository.php
author ymh <ymh.work@gmail.com>
Wed, 08 Feb 2017 15:25:24 +0100
changeset 502 74fba571487e
parent 326 226d5b17a119
permissions -rw-r--r--
Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
<?php
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
namespace CorpusParole\Repositories;
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
     4
use CorpusParole\Models\Document;
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
     5
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
interface DocumentRepository {
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
     7
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
    public function all();
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
306
3fccf43160a7 Some more changes linked to the change of api organization + some jshint error cleaning
ymh <ymh.work@gmail.com>
parents: 168
diff changeset
    10
    public function get($id, $short = false);
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
    11
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
    12
    public function save(Document $doc);
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
    13
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
    14
    /**
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
    15
     * Paginate all document as a paginator.
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
    16
     *
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
    17
     * @param  int  $perPage
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
    18
     * @param  string  $pageName
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
    19
     * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
    20
     */
22
a50cbd7d702f small change in pagination and add missing .env template
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    21
    public function paginateAll($perPage = 15, $pageName = 'page', $page = null);
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
    22
125
e550b10fe3ca add language resolver on api data
ymh <ymh.work@gmail.com>
parents: 22
diff changeset
    23
    /**
326
226d5b17a119 - First implementation of filter for languages.
ymh <ymh.work@gmail.com>
parents: 306
diff changeset
    24
     * Paginate filtered document as a paginator.
226d5b17a119 - First implementation of filter for languages.
ymh <ymh.work@gmail.com>
parents: 306
diff changeset
    25
     *
226d5b17a119 - First implementation of filter for languages.
ymh <ymh.work@gmail.com>
parents: 306
diff changeset
    26
     * @param  array $filters
226d5b17a119 - First implementation of filter for languages.
ymh <ymh.work@gmail.com>
parents: 306
diff changeset
    27
     * @param  int  $perPage
226d5b17a119 - First implementation of filter for languages.
ymh <ymh.work@gmail.com>
parents: 306
diff changeset
    28
     * @param  string  $pageName
226d5b17a119 - First implementation of filter for languages.
ymh <ymh.work@gmail.com>
parents: 306
diff changeset
    29
     * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator
226d5b17a119 - First implementation of filter for languages.
ymh <ymh.work@gmail.com>
parents: 306
diff changeset
    30
     */
226d5b17a119 - First implementation of filter for languages.
ymh <ymh.work@gmail.com>
parents: 306
diff changeset
    31
    public function paginate($filters = [], $perPage = 15, $pageName = 'page', $page = null, $sort = null);
226d5b17a119 - First implementation of filter for languages.
ymh <ymh.work@gmail.com>
parents: 306
diff changeset
    32
226d5b17a119 - First implementation of filter for languages.
ymh <ymh.work@gmail.com>
parents: 306
diff changeset
    33
226d5b17a119 - First implementation of filter for languages.
ymh <ymh.work@gmail.com>
parents: 306
diff changeset
    34
    /**
125
e550b10fe3ca add language resolver on api data
ymh <ymh.work@gmail.com>
parents: 22
diff changeset
    35
     * Resolve lexvo id for all documents in the list
e550b10fe3ca add language resolver on api data
ymh <ymh.work@gmail.com>
parents: 22
diff changeset
    36
     * this allow to optimise the call of lexvo repository
502
74fba571487e Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents: 326
diff changeset
    37
     * This will modify the documents.
74fba571487e Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents: 326
diff changeset
    38
     *
74fba571487e Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents: 326
diff changeset
    39
     * @param array
74fba571487e Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents: 326
diff changeset
    40
     * @return nothing
125
e550b10fe3ca add language resolver on api data
ymh <ymh.work@gmail.com>
parents: 22
diff changeset
    41
     */
e550b10fe3ca add language resolver on api data
ymh <ymh.work@gmail.com>
parents: 22
diff changeset
    42
    public function resolveLexvo(Array $docList);
e550b10fe3ca add language resolver on api data
ymh <ymh.work@gmail.com>
parents: 22
diff changeset
    43
502
74fba571487e Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents: 326
diff changeset
    44
    /**
74fba571487e Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents: 326
diff changeset
    45
     * Add country info for document.
74fba571487e Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents: 326
diff changeset
    46
     * This modify the document
74fba571487e Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents: 326
diff changeset
    47
     *
74fba571487e Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents: 326
diff changeset
    48
     * @param $doc the document instance
74fba571487e Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents: 326
diff changeset
    49
     * @return nothing
74fba571487e Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents: 326
diff changeset
    50
     */
74fba571487e Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents: 326
diff changeset
    51
    public function addCountryInfo($doc);
74fba571487e Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents: 326
diff changeset
    52
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
    53
    public function getCount();
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
    54
}