File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,9 +25,13 @@ abstract class Api extends Singleton
2525{
2626 use ManagerTrait, ApiListTrait, ApiCrudResponseTrait;
2727
28+ const API_COMBO_FIELD = '__combo ' ;
2829 const API_LIST_NAME_FIELD = '__name__ ' ;
2930 const API_FIELDS_RESULT_FIELD = '__fields ' ;
3031 const API_MODEL_KEY_FIELD = '__pk ' ;
32+ const API_ORDER_FIELD = '__order ' ;
33+ const API_PAGE_FIELD = '__page ' ;
34+ const API_LIMIT_FIELD = '__limit ' ;
3135 const API_PK_SEPARATOR = '__|__ ' ;
3236
3337 const API_ACTION_LIST = 'list ' ;
Original file line number Diff line number Diff line change 55use Exception ;
66use PSFS \base \Logger ;
77use PSFS \base \Request ;
8+ use PSFS \base \types \Api ;
89use PSFS \base \types \helpers \AnnotationHelper ;
910use PSFS \base \types \helpers \MetadataReader ;
1011use PSFS \base \types \helpers \attributes \Header ;
@@ -148,21 +149,21 @@ private function buildNativeQueryParams(): array
148149 {
149150 return [
150151 [
151- "name " => " __limit " ,
152+ "name " => Api:: API_LIMIT_FIELD ,
152153 "in " => "query " ,
153154 "description " => t ("Record limit to return, -1 to return all records " ),
154155 "required " => false ,
155156 "type " => "integer " ,
156157 ],
157158 [
158- "name " => " __page " ,
159+ "name " => Api:: API_PAGE_FIELD ,
159160 "in " => "query " ,
160161 "description " => t ("Page to return " ),
161162 "required " => false ,
162163 "type " => "integer " ,
163164 ],
164165 [
165- "name " => " __fields " ,
166+ "name " => Api:: API_FIELDS_RESULT_FIELD ,
166167 "in " => "query " ,
167168 "description " => t ("Fields to return " ),
168169 "required " => false ,
Original file line number Diff line number Diff line change 55use Propel \Runtime \ActiveQuery \ModelCriteria ;
66use PSFS \base \dto \Order ;
77use PSFS \base \Logger ;
8+ use PSFS \base \types \Api ;
89use PSFS \base \types \helpers \ApiHelper ;
910use PSFS \base \types \helpers \attributes \Injectable ;
1011use PSFS \base \types \traits \Api \MutationTrait ;
@@ -139,22 +140,22 @@ protected function paginate()
139140
140141 private function apiComboField (): string
141142 {
142- return ' __combo ' ;
143+ return Api:: API_COMBO_FIELD ;
143144 }
144145
145146 private function apiOrderField (): string
146147 {
147- return ' __order ' ;
148+ return Api:: API_ORDER_FIELD ;
148149 }
149150
150151 private function apiPageField (): string
151152 {
152- return ' __page ' ;
153+ return Api:: API_PAGE_FIELD ;
153154 }
154155
155156 private function apiLimitField (): string
156157 {
157- return ' __limit ' ;
158+ return Api:: API_LIMIT_FIELD ;
158159 }
159160
160161}
You can’t perform that action at this time.
0 commit comments