Product::splitFieldsByEntity

  1. Bitrix24 API (v. 23.675.0)
  2. catalog
  3. Product
  4. splitFieldsByEntity
  • Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/controller/product.php
  • Класс: BitrixCatalogControllerProduct
  • Вызов: Product::splitFieldsByEntity
protected function splitFieldsByEntity($fields): array
{
	$productFields = [];
	$elementFields = [];
	$propertyFields = [];

	foreach($fields as $name=>$value)
	{
		if(in_array($name, $this->getAllowedFieldsProduct()))
		{
			$productFields[$name] = $value;
		}
		else
		{
			if (preg_match('/^(PROPERTY_d+)$/', $name))
			{
				$propertyFields[$name] = $value;
			}
			else
			{
				$elementFields[$name] = $value;
			}
		}
	}

	return [
		'productFields'=>$productFields,
		'propertyFields'=>$propertyFields,
		'elementFields'=>$elementFields
	];
}

Добавить комментарий