• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/restview/product.php
  • Класс: BitrixCatalogRestViewProduct
  • Вызов: Product::checkFieldsList
public function checkFieldsList($arguments): Result
{
	$r = new Result();

	$select = $arguments['select'] ?? [];
	if (!is_array($select))
	{
		$select = [];
	}

	$error = [];
	if (!in_array('ID', $select))
	{
		$error[] = 'id';
	}
	if (!in_array('IBLOCK_ID', $select))
	{
		$error[] = 'iblockId';
	}

	if (!empty($error))
	{
		$r->addError(new Error('Required select fields: ' . implode(', ', $error)));
	}

	if (!isset($arguments['filter']['IBLOCK_ID']))
	{
		$r->addError(new Error('Required filter fields: iblockId'));
	}

	return $r;
}