1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
ExportStep.php
См. документацию.
1<?php
2
3namespace Bitrix\UI\Integration\Rest;
4
5use \Bitrix\Main;
6
7
8abstract class ExportStep {
9 //region input info
10 public string $entityCode;
11 public $entityId;
13 public int $stepNumber;
14 //end region
15 //region OutputInfo
20 //endregion
21 public function __construct(Main\Event $event)
22 {
23 $this->entityCode = $event->getParameter('CODE');
24 $this->entityId = $event->getParameter('ITEM_CODE');
25 $this->stepNumber = (int) $event->getParameter('STEP');
26 $data = json_decode($event->getParameter('NEXT') ?: '', true);
27 $this->previousStep = new Main\Type\Dictionary(($data ?: []));
28
29 $this->data = new Main\Type\Dictionary();
30 $this->files = new Main\Type\Dictionary();
31 $this->nextStep = new Main\Type\Dictionary();
32 $this->errorCollection = new Main\ErrorCollection();
33
34 $this->init();
35 }
36
37 abstract public function init(): void;
38
39 public function makeAnAnswer(): ?array
40 {
41 return [
42 'FILE_NAME' =>
43 implode('_',
44 [
45 (new \ReflectionClass(static::class))->getShortName(),
46 $this->entityCode,
47 $this->entityId,
48 $this->stepNumber
49 ]
50 ),
51 'CONTENT' => $this->data->toArray(),
52 'FILES' => $this->files->toArray(),
53 'NEXT' => $this->nextStep->count() <= 0
54 ? false : json_encode($this->nextStep->toArray()),
55
56 ] + (($error = $this->errorCollection->current()) ? [
57 'ERROR_MESSAGE' => $error->getMessage(),
58 'ERROR_ACTION' => $error->getCode(),
59 ] : []);
60 }
61
62 public static function fulfill(Main\Event $event): array
63 {
64 $step = new static($event);
65 return $step->makeAnAnswer();
66 }
67}
Main Type Dictionary $next
Определения ExportStep.php:18
static fulfill(Main\Event $event)
Определения ExportStep.php:62
Main ErrorCollection $errorCollection
Определения ExportStep.php:19
Main Type Dictionary $previous
Определения ExportStep.php:12
Main Type Dictionary $data
Определения ExportStep.php:16
__construct(Main\Event $event)
Определения ExportStep.php:21
Main Type Dictionary $files
Определения ExportStep.php:17
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
Определения buffer.php:3
$event
Определения prolog_after.php:141
return false
Определения prolog_main_admin.php:185
$error
Определения subscription_card_product.php:20