• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/cashbox/check.php
  • Класс: BitrixSaleCashboxCheck
  • Вызов: Check::checkRelatedEntities
protected function checkRelatedEntities($entities)
{
	foreach ($entities as $type => $entityList)
	{
		foreach ($entityList as $entity)
		{
			if (static::getSupportedRelatedEntityType() === self::SUPPORTED_ENTITY_TYPE_NONE)
			{
				throw new MainNotSupportedException(static::getType().' is not supported any related entities');
			}

			if (static::getSupportedRelatedEntityType() === self::SUPPORTED_ENTITY_TYPE_PAYMENT
				&& !($entity instanceof Payment)
			)
			{
				throw new MainNotSupportedException(static::getType().' is not supported payment as related entity');
			}

			if (static::getSupportedRelatedEntityType() === self::SUPPORTED_ENTITY_TYPE_SHIPMENT
				&& !($entity instanceof Shipment)
			)
			{
				throw new MainNotSupportedException(static::getType().' is not supported shipment as related entity');
			}
		}
	}
}