Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
ContextConstants | n/a |
0 / 0 |
n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||
__construct | n/a |
0 / 0 |
n/a |
0 / 0 |
1 |
1 | <?php |
2 | namespace Apie\Core; |
3 | |
4 | use Apie\Common\Actions\RunAction; |
5 | use Apie\Common\Actions\RunItemMethodAction; |
6 | use Apie\Core\Actions\HasRouteDefinition; |
7 | use Apie\Core\Indexing\FromDateObject; |
8 | use Apie\DoctrineEntityDatalayer\Query\RequiresPermissionFilter; |
9 | |
10 | /** |
11 | * Contains a list of context key constants as used for ApieContext and in route definitions (which are copied to |
12 | * ApieContext values). |
13 | */ |
14 | final class ContextConstants |
15 | { |
16 | /** |
17 | * @codeCoverageIgnore |
18 | */ |
19 | private function __construct() |
20 | { |
21 | } |
22 | |
23 | /** |
24 | * Get the underlying framework in lowercase: 'symfony', 'laravel' |
25 | */ |
26 | public const FRAMEWORK = 'framework'; |
27 | |
28 | /** |
29 | * ID of the selected bounded context. |
30 | */ |
31 | public const BOUNDED_CONTEXT_ID = 'boundedContextId'; |
32 | /** |
33 | * Name of resource entity. Used by getting and creating resources of a specific class. |
34 | */ |
35 | public const RESOURCE_NAME = 'resourceName'; |
36 | |
37 | /** |
38 | * Id of resource. This one is often filled in the routing placeholder. |
39 | */ |
40 | public const RESOURCE_ID = 'id'; |
41 | |
42 | /** |
43 | * Resource retrieved that we can apply actions to. |
44 | */ |
45 | public const RESOURCE = 'resource'; |
46 | |
47 | /** |
48 | * Internal operation id of action used. |
49 | * |
50 | * @see HasRouteDefinition::getOperationId() |
51 | */ |
52 | public const OPERATION_ID = 'operationId'; |
53 | |
54 | /** |
55 | * Internal class used for the Apie action. |
56 | */ |
57 | public const APIE_ACTION = '_apie_action'; |
58 | |
59 | /** |
60 | * Used for running a specific method call. |
61 | * @see RunAction |
62 | */ |
63 | public const SERVICE_CLASS = 'serviceClass'; |
64 | |
65 | /** |
66 | * Used for picking the right class of a method. |
67 | * |
68 | * @see RunItemMethodAction |
69 | */ |
70 | public const METHOD_CLASS = 'methodClass'; |
71 | |
72 | /** |
73 | * Used for running a specific method call. |
74 | * @see RunAction |
75 | * @see RunItemMethodAction |
76 | */ |
77 | public const METHOD_NAME = 'methodName'; |
78 | |
79 | /** |
80 | * Raw contents of POST body or GET parameters. |
81 | */ |
82 | public const RAW_CONTENTS = 'raw-contents'; |
83 | |
84 | /** |
85 | * Last validation errors |
86 | */ |
87 | public const VALIDATION_ERRORS = 'validation-errors'; |
88 | |
89 | /** |
90 | * Added if an OpenAPI spec is generated. |
91 | */ |
92 | public const OPENAPI = 'openapi'; |
93 | |
94 | /** |
95 | * Added if a REST API call is done. |
96 | */ |
97 | public const REST_API='rest'; |
98 | |
99 | /** |
100 | * Added if CMS request is done. |
101 | */ |
102 | public const CMS='cms'; |
103 | |
104 | /** |
105 | * Added if serializing the profile fields in apie/cms |
106 | */ |
107 | public const SHOW_PROFILE = 'show_profile'; |
108 | |
109 | public const CREATE_OBJECT = 'create'; |
110 | |
111 | public const REPLACE_OBJECT = 'replace'; |
112 | |
113 | public const EDIT_OBJECT = 'edit'; |
114 | |
115 | public const REMOVE_OBJECT = 'remove'; |
116 | |
117 | public const GET_ALL_OBJECTS = 'all'; |
118 | |
119 | public const GET_OBJECT = 'get'; |
120 | |
121 | public const RESOURCE_METHOD = 'resource-call'; |
122 | |
123 | public const GLOBAL_METHOD = 'method-call'; |
124 | |
125 | /** |
126 | * Disable context filter when using toPaginatedResult |
127 | * |
128 | * @see RequiresPermissionFilter |
129 | */ |
130 | public const DISABLE_CONTEXT_FILTER = 'disable-context-filter'; |
131 | |
132 | /** |
133 | * @see FromDateObject |
134 | * @configured date formats for DateTime objects for indexing. |
135 | */ |
136 | public const DATEFORMATS = 'date-formats'; |
137 | |
138 | /** |
139 | * Displays a form on this page. |
140 | */ |
141 | public const DISPLAY_FORM = 'display-form'; |
142 | |
143 | public const AUTHENTICATED_USER = 'authenticated'; |
144 | |
145 | public const LOCALE = 'locale'; |
146 | |
147 | /** |
148 | * Used for workarounds with frameworks using middleware or events for authentication and redoing the controller |
149 | * again. |
150 | * |
151 | * @internal |
152 | */ |
153 | public const ALREADY_CALCULATED = 'already_calculated'; |
154 | |
155 | public const BACKGROUND_PROCESS = 'background_process'; |
156 | } |