Fill::getAppliedAgreements

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. Fill
  4. getAppliedAgreements
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/webform/fill.php
  • Класс: Bitrix\Crm\WebForm\Fill
  • Вызов: Fill::getAppliedAgreements
private function getAppliedAgreements(): array
{
	$formData = $this->form->get();
	if ($formData['USE_LICENCE'] != 'Y')
	{
		return [];
	}

	$list = array_column($formData['AGREEMENTS'], 'AGREEMENT_ID');
	$agreements = [];
	foreach ($this->consents as $name => $value)
	{
		if ($value <> 'Y')
		{
			continue;
		}

		$id = (int)preg_replace('/[^\d]/', '', $name);
		if (!$id || !in_array($id, $list))
		{
			continue;
		}
		$agreements[] = $id;
	}

	return $agreements;
}

Добавить комментарий