• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/discount/gift/manager.php
  • Класс: Bitrix\Sale\Discount\Gift\Manager
  • Вызов: Manager::isValidProduct
private function isValidProduct(array $product)
{
	if(empty($product['ID']))
	{
		$this->errorCollection[] = new Error('Product array has to have ID');
	}
	if(empty($product['MODULE']))
	{
		$this->errorCollection[] = new Error('Product array has to have MODULE');
	}
	if(empty($product['PRODUCT_PROVIDER_CLASS']))
	{
		$this->errorCollection[] = new Error('Product array has to have PRODUCT_PROVIDER_CLASS');
	}
	if(empty($product['QUANTITY']))
	{
		$this->errorCollection[] = new Error('Product array has to have QUANTITY');
	}
	if($this->errorCollection->count())
	{
		return false;
	}

	return true;
}