18 private $errorList = [];
29 if (!empty($setting[
'CONTEXT']))
31 $this->context = $setting[
'CONTEXT'];
34 if (!empty($setting[
'CONTEXT_USER']))
36 $this->contextUser = $setting[
'CONTEXT_USER'];
69 abstract public function addContent(
string $code, $content, $type =
false): bool;
77 abstract public function addFiles(array $files): array;
87 abstract public function get(
string $path,
int $step): ?array;
95 public function getContent(
string $path,
int $step): array
107 $content = $this->
get($path, $step);
108 if (!is_null($content[
'DATA']))
110 $result[
'~DATA'] = Json::decode($content[
'DATA']);
111 if (!empty($result[
'~DATA']))
121 if ($content[
'FILE_NAME'])
123 $result[
'FILE_NAME'] = preg_replace(
126 $content[
'FILE_NAME']
130 if (!empty($content[
'COUNT']) && (
int)$content[
'COUNT'] > 0)
132 $result[
'COUNT'] = (int)$content[
'COUNT'];
156 if (is_array($content))
160 $result = Json::encode($content);
165 $this->
addError(
'ERROR_JSON_ENCODE',
'');
169 elseif (is_string($content))
187 $this->errorList[$code] = $message;
199 return $this->errorList;
209 $this->errorList = [];
const ERROR_DATA_NOT_FOUND
addContent(string $code, $content, $type=false)
__construct(array $setting)
getContent(string $path, int $step)
addError($code, $message)
const CONFIGURATION_FILE_EXTENSION