- Модуль: sale
- Путь к файлу: ~/bitrix/modules/sale/lib/location/util/process.php
- Класс: BitrixSaleLocationUtilProcess
- Вызов: Process::addStage
public function addStage($params)
{
if (empty($params['CODE']) || empty($params['CALLBACK']))
{
throw new MainSystemException('Not enought params to add stage');
}
$ss = (int)($params['STEP_SIZE'] ?? 0);
$order = count($this->stages);
$type = (string)($params['TYPE'] ?? '');
if ($type === '')
{
$type = static::CALLBACK_TYPE_MANUAL;
}
$beforeCallback = (string)($params['ON_BEFORE_CALLBACK'] ?? '');
if ($beforeCallback === '')
{
$beforeCallback = false;
}
$afterCallback = (string)($params['ON_AFTER_CALLBACK'] ?? '');
if ($afterCallback === '')
{
$afterCallback = false;
}
$this->stages[] = [
'STEP_SIZE' => $ss ?: 1,
'PERCENT' => (int)($params['PERCENT'] ?? 0),
'CODE' => $params['CODE'],
'ORDER' => $order,
'TYPE' => $type,
'CALLBACK' => $params['CALLBACK'],
'SUBPERCENT_CALLBACK' => $params['SUBPERCENT_CALLBACK'] ?? null,
'ON_BEFORE_CALLBACK' => $beforeCallback,
'ON_AFTER_CALLBACK' => $afterCallback,
];
$this->stagesByCode[$params['CODE']] =& $this->stages[count($this->stages) - 1];
}