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
2namespace Apie\Core;
3
4use Apie\Common\Actions\RunAction;
5use Apie\Common\Actions\RunItemMethodAction;
6use Apie\Core\Actions\HasRouteDefinition;
7use Apie\Core\Indexing\FromDateObject;
8use 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 */
14final 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 MCP Server list is being created.
96     */
97    public const MCP_SERVER = 'mcp-server';
98
99    /**
100     * Added if a REST API call is done.
101     */
102    public const REST_API='rest';
103
104    /**
105     * Added if CMS request is done.
106     */
107    public const CMS='cms';
108
109    /**
110     * Added if serializing the profile fields in apie/cms
111     */
112    public const SHOW_PROFILE = 'show_profile';
113
114    public const CREATE_OBJECT = 'create';
115
116    public const REPLACE_OBJECT = 'replace';
117
118    public const EDIT_OBJECT = 'edit';
119
120    public const REMOVE_OBJECT = 'remove';
121
122    public const GET_ALL_OBJECTS = 'all';
123
124    public const GET_OBJECT = 'get';
125
126    public const RESOURCE_METHOD = 'resource-call';
127
128    public const GLOBAL_METHOD = 'method-call';
129
130    /**
131     * Disable context filter when using toPaginatedResult
132     *
133     * @see RequiresPermissionFilter
134     */
135    public const DISABLE_CONTEXT_FILTER = 'disable-context-filter';
136
137    /**
138     * @see FromDateObject
139     * @configured date formats for DateTime objects for indexing.
140     */
141    public const DATEFORMATS = 'date-formats';
142
143    /**
144     * Displays a form on this page.
145     */
146    public const DISPLAY_FORM = 'display-form';
147
148    public const AUTHENTICATED_USER = 'authenticated';
149
150    public const LOCALE = 'locale';
151
152    /**
153     * Used for workarounds with frameworks using middleware or events for authentication and redoing the controller
154     * again.
155     *
156     * @internal
157     */
158    public const ALREADY_CALCULATED = 'already_calculated';
159
160    public const BACKGROUND_PROCESS = 'background_process';
161}