24 $event =
new Event(
'rest', static::ON_REST_APP_CONFIGURATION_ENTITY);
25 EventManager::getInstance()->send($event);
26 foreach ($event->getResults() as $eventResult)
28 $codeList = $eventResult->getParameters();
29 if (is_array($codeList))
31 $result = array_merge($result, $codeList);
36 return array_keys($result);
39 public static function callEventExport($manifestCode, $code, $step = 0, $next =
'', $itemCode =
'', $contextUser =
false)
42 if ($manifestCode ==
'')
48 if (!is_null($manifest))
50 $setting =
new Setting($contextUser);
54 static::ON_REST_APP_CONFIGURATION_EXPORT,
59 'MANIFEST' => $manifest,
60 'ITEM_CODE' => $itemCode,
65 EventManager::getInstance()->send($event);
66 foreach ($event->getResults() as $eventResult)
68 $parameters = $eventResult->getParameters();
70 'FILE_NAME' => $parameters[
'FILE_NAME'],
71 'CONTENT' => $parameters[
'CONTENT'],
72 'FILES' => $parameters[
'FILES'],
73 'NEXT' => $parameters[
'NEXT'],
74 'ERROR_MESSAGES' => $parameters[
'ERROR_MESSAGES'],
75 'ERROR_ACTION' => $parameters[
'ERROR_ACTION'],
76 'ERROR_EXCEPTION' => $parameters[
'ERROR_EXCEPTION'],
90 $data[
'SETTING'] =
null;
91 if (isset($data[
'CONTEXT_USER']))
93 $setting =
new Setting($data[
'CONTEXT_USER']);
100 static::ON_REST_APP_CONFIGURATION_CLEAR,
103 EventManager::getInstance()->send($event);
104 foreach ($event->getResults() as $eventResult)
106 $parameters = $eventResult->getParameters();
108 'NEXT' => $parameters[
'NEXT'] ??
null,
109 'ERROR_MESSAGES' => $parameters[
'ERROR_MESSAGES'] ??
null,
110 'ERROR_ACTION' => $parameters[
'ERROR_ACTION'] ??
null,
111 'ERROR_EXCEPTION' => $parameters[
'ERROR_EXCEPTION'] ?? null
114 if (!empty($parameters[
'OWNER_DELETE']) && is_array($parameters[
'OWNER_DELETE']))
126 $params[
'CONTEXT_USER'] = $params[
'CONTEXT_USER'] ?:
false;
127 $setting =
new Setting($params[
'CONTEXT_USER']);
143 static::ON_REST_APP_CONFIGURATION_IMPORT,
145 'CODE' => $params[
'CODE'],
146 'CONTENT' => $params[
'CONTENT'],
147 'RATIO' => $params[
'RATIO'],
148 'CONTEXT' => $params[
'CONTEXT'],
149 'CONTEXT_USER' => $params[
'CONTEXT_USER'],
152 'MANIFEST_CODE' => $params[
'MANIFEST_CODE'],
153 'IMPORT_MANIFEST' => $params[
'IMPORT_MANIFEST'],
154 'ADDITIONAL_OPTION' => is_array($params[
'ADDITIONAL_OPTION']) ? $params[
'ADDITIONAL_OPTION'] : [],
155 'APP_ID' => intVal($owner),
159 EventManager::getInstance()->
send($event);
160 foreach ($event->getResults() as $eventResult)
162 $parameters = $eventResult->getParameters();
164 'RATIO' => $parameters[
'RATIO'],
165 'ERROR_MESSAGES' => $parameters[
'ERROR_MESSAGES'] ??
null,
166 'ERROR_ACTION' => $parameters[
'ERROR_ACTION'] ??
null,
167 'ERROR_EXCEPTION' => $parameters[
'ERROR_EXCEPTION']
170 if (isset($parameters[
'OWNER_DELETE']) && is_array($parameters[
'OWNER_DELETE']))
175 if (!empty($parameters[
'OWNER']))
189 static::ON_REST_APP_CONFIGURATION_FINISH,
192 EventManager::getInstance()->send($event);
193 foreach ($event->getResults() as $eventResult)
195 $parameters = $eventResult->getParameters();
197 'CREATE_DOM_LIST' => $parameters[
'CREATE_DOM_LIST'],
198 'ADDITIONAL' => $parameters[
'ADDITIONAL'],
static getEntityCodeList()
const ON_REST_APP_CONFIGURATION_CLEAR
const ON_REST_APP_CONFIGURATION_EXPORT
static callEventExport($manifestCode, $code, $step=0, $next='', $itemCode='', $contextUser=false)
const ON_REST_APP_CONFIGURATION_ENTITY
static callEventClear($data)
const ON_REST_APP_CONFIGURATION_IMPORT
static callEventImport($params)
const ON_REST_APP_CONFIGURATION_FINISH
static callEventFinish($params)
static saveMulti($owner, $ownerType, $itemList)
static deleteMulti($itemList)
const ENTITY_TYPE_APPLICATION
const ENTITY_TYPE_EXTERNAL