325 if (!isset($this->stack[$step]))
330 $item = $this->stack[$step];
332 if (!$action || !$action->delete())
337 if (isset($item[
'MULTIPLY']) && is_array($item[
'MULTIPLY']) && !empty($item[
'MULTIPLY']))
339 foreach ($item[
'MULTIPLY'] as $multyId)
341 $resDelete = HistoryTable::delete($multyId);
342 if (!$resDelete->isSuccess())
350 $resDelete = HistoryTable::delete($item[
'ID']);
351 if (!$resDelete->isSuccess())
358 unset($this->stack[$step]);
360 if ($step <= $this->step)
362 return $this->
saveStep($this->step - 1);
570 public function push(
string $actionName, array $params): bool
572 $actionName = strtoupper($actionName);
580 $action->setParams($params);
583 'ENTITY_TYPE' => $this->entityType,
584 'ENTITY_ID' => $this->entityId,
585 'ACTION' => $actionName,
586 'ACTION_PARAMS' => $action->getParams(),
593 !empty($this->stack[$this->step])
600 if (!$action->isNeedPush())
606 if ($this->step < $stackCount)
615 (self::$multiplyMode && self::$multiplyStep !==
null)
616 ? self::$multiplyStep
625 self::$multiplyStep = $nextStep;
628 if (self::$multiplyMode && self::$multiplyId !==
null)
630 $fields[
'MULTIPLY_ID'] = self::$multiplyId;
633 $resAdd = HistoryTable::add($fields);
636 if (self::$multiplyMode && self::$multiplyId ===
null)
638 self::$multiplyId = $resAdd->getId();
639 HistoryTable::update(self::$multiplyId, [
640 'MULTIPLY_ID' => self::$multiplyId,
644 return $resAdd->isSuccess();
718 if (!isset($this->stack[$step]))
723 $stepItem = $this->stack[$step];
724 $stepId = $stepItem[
'ID'];
726 if (isset($this->actions[$stepId][$direction]))
728 return $this->actions[$stepId][$direction];
731 $params = $stepItem[
'ACTION_PARAMS'];
732 if ($this->entityType === self::ENTITY_TYPE_LANDING)
734 $params[
'lid'] = $this->entityId;
736 if ($this->entityType === self::ENTITY_TYPE_DESIGNER_BLOCK)
738 $params[
'blockId'] = $this->entityId;
747 $action->setParams($params,
true);
748 $this->actions[$stepId][$direction] = $action;