• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/restview/product.php
  • Класс: BitrixCatalogRestViewProduct
  • Вызов: Product::isPropertyBoolean
private function isPropertyBoolean(array $property): bool
{
	if (($property['PROPERTY_TYPE'] ?? '') !== PropertyTable::TYPE_LIST)
	{
		return false;
	}
	$attributes = $property['ATTRIBUTES'] ?? [];
	if (!is_array($attributes))
	{
		$attributes = [];
	}
	if (in_array(Attributes::MULTIPLE, $attributes, true))
	{
		return false;
	}
	$userType = (string)($property['USER_TYPE'] ?? '');
	if ($userType !== '' && $userType !== CatalogControllerEnum::PROPERTY_USER_TYPE_BOOL_ENUM)
	{
		return false;
	}
	return (!empty($property['BOOLEAN_VALUE_YES']) && is_array($property['BOOLEAN_VALUE_YES']));
}