• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/kanban/entity/dealactivities.php
  • Класс: Bitrix\Crm\Kanban\Entity\DealActivities
  • Вызов: DealActivities::updateItemStage
public function updateItemStage(int $id, string $stageId, array $newStateParams, array $stages): Result
{
	$result = $this->getItemViaLoadedItems($id);
	if (!$result->isSuccess())
	{
		return $result;
	}

	$item = $result->getData()['item'];

	$stageCategoryID = DealCategory::resolveFromStageID($stageId);
	$dealCategoryID = (int) $item['CATEGORY_ID'];
	if($dealCategoryID !== $stageCategoryID && $this->getCategoryId() >= 0)
	{
		return $result->addError(new Error(Loc::getMessage('CRM_KANBAN_ERROR_DEAL_STAGE_MISMATCH')));
	}

	return $this->changeStageByActivity($stageId, $id);
}