1 | <?php namespace Neomerx\JsonApi\Http\Query; |
||
24 | class BaseQueryParser implements BaseQueryParserInterface |
||
25 | { |
||
26 | use BaseQueryParserTrait { |
||
27 | BaseQueryParserTrait::getFields as getFieldsImpl; |
||
28 | BaseQueryParserTrait::getIncludes as getIncludesImpl; |
||
29 | BaseQueryParserTrait::getSorts as getSortsImpl; |
||
30 | } |
||
31 | |||
32 | /** Message */ |
||
33 | public const MSG_ERR_INVALID_PARAMETER = 'Invalid Parameter.'; |
||
34 | |||
35 | /** |
||
36 | * @var array |
||
37 | */ |
||
38 | private $parameters; |
||
39 | |||
40 | /** |
||
41 | * @var string[]|null |
||
42 | */ |
||
43 | private $messages; |
||
44 | |||
45 | /** |
||
46 | * @param array $parameters |
||
47 | * @param string[]|null $messages |
||
48 | */ |
||
49 | 13 | public function __construct(array $parameters = [], array $messages = null) |
|
53 | |||
54 | /** |
||
55 | * @inheritdoc |
||
56 | */ |
||
57 | 4 | public function getFields(): iterable |
|
61 | |||
62 | /** |
||
63 | * @inheritdoc |
||
64 | */ |
||
65 | 10 | public function getIncludes(): iterable |
|
69 | |||
70 | /** |
||
71 | * @inheritdoc |
||
72 | */ |
||
73 | 2 | public function getSorts(): iterable |
|
77 | |||
78 | /** |
||
79 | * @param array $parameters |
||
80 | * |
||
81 | * @return self |
||
82 | */ |
||
83 | 13 | protected function setParameters(array $parameters): self |
|
89 | |||
90 | /** |
||
91 | * @return array |
||
92 | */ |
||
93 | 13 | protected function getParameters(): array |
|
97 | |||
98 | /** |
||
99 | * @param array $messages |
||
100 | * |
||
101 | * @return self |
||
102 | */ |
||
103 | 13 | protected function setMessages(?array $messages): self |
|
109 | |||
110 | /** |
||
111 | * @param string $message |
||
112 | * |
||
113 | * @return string |
||
114 | */ |
||
115 | 13 | protected function getMessage(string $message): string |
|
121 | } |
||
122 |