Total Complexity | 6 |
Total Lines | 53 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php namespace Pz\Doctrine\Rest\QueryParser; |
||
6 | class SearchFilterParser extends FilterParserAbstract |
||
7 | { |
||
8 | const PARAM_PREFIX = ''; |
||
9 | |||
10 | const SEARCH_KEY = 'search'; |
||
11 | |||
12 | /** |
||
13 | * @var string|bool |
||
14 | */ |
||
15 | protected $property; |
||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $searchKey; |
||
21 | |||
22 | /** |
||
23 | * StringParser constructor. |
||
24 | * |
||
25 | * @param RestRequestContract $request |
||
26 | * @param string $property Property name that will be filtered by query. |
||
27 | * @param string $searchKey |
||
28 | */ |
||
29 | 14 | public function __construct(RestRequestContract $request, $property, $searchKey = self::SEARCH_KEY) |
|
34 | 14 | } |
|
35 | |||
36 | /** |
||
37 | * Assign LIKE operator on property if query is string. |
||
38 | * |
||
39 | * @param Criteria $criteria |
||
40 | * @param $filter |
||
41 | * |
||
42 | * @return Criteria |
||
43 | */ |
||
44 | 14 | public function applyFilter(Criteria $criteria, $filter) |
|
61 |