• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/delivery/services/manager.php
  • Класс: BitrixSaleDeliveryServicesManager
  • Вызов: Manager::checkServiceUsage
static function checkServiceUsage($deliveryId)
{
	$result = new Result();

	if(self::isDeliveryInShipments($deliveryId))
	{
		$result->addError(new Error(Loc::getMessage('SALE_DLVR_MNGR_ERR_DEL_IN_SHPMNTS_EXIST')));
	}
	else
	{
		$dbRes = Table::getList(array(
			'filter' => array(
				"PARENT_ID" => $deliveryId
			),
			'select' => array("ID")
		));

		while($child = $dbRes->fetch())
		{
			if(self::isDeliveryInShipments($child["ID"]))
			{
				$result->addError(new Error(Loc::getMessage('SALE_DLVR_MNGR_ERR_DEL_IN_SHPMNTS_EXIST_CHLD')));
				break;
			}
		}
	}

	return $result;
}