represents::setStage

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. represents
  4. setStage
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/binding/orderpaymentstagetable.php
  • Класс: Bitrix\Crm\Binding\represents
  • Вызов: represents::setStage
static function setStage(int $paymentId, string $stage)
{
	$row = static::getById($paymentId)->fetch();
	if ($row)
	{
		if ($row['STAGE'] !== $stage)
		{
			return static::update($paymentId, ['STAGE' => $stage]);
		}
		else
		{
			return null;
		}
	}
	else
	{
		return static::add([
			'PAYMENT_ID' => $paymentId,
			'STAGE' => $stage,
		]);
	}
}

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