ResponsibleQueue::getNextId

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. ResponsibleQueue
  4. getNextId
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/webform/responsiblequeue.php
  • Класс: Bitrix\Crm\WebForm\ResponsibleQueue
  • Вызов: ResponsibleQueue::getNextId
public function getNextId()
{
	if (count($this->list) == 0)
	{
		return null;
	}

	$nextId = null;
	$reservedId = null;
	$list = $this->getStack();
	foreach ($list as $id)
	{
		if (!$this->checkId($id))
		{
			continue;
		}

		if (!$this->checkWorkTimeId($id))
		{
			if (!$reservedId)
			{
				$reservedId = $id;
			}

			continue;
		}

		$nextId = $id;
		break;
	}

	if (!$nextId)
	{
		$nextId = $reservedId ? $reservedId : $list[0];
	}

	if ($nextId && $this->autoSetLastId)
	{
		$this->setLastId($nextId);
	}

	return $nextId;
}

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