Здравствуйте,
Каждый товар в магазине имеет дополнительное свойство типа "флажок", множественные значения для свойства запрещены.
Как вывести все товары магазина где я поставил галочку на этом дополнительном свойстве?
С элементами информационной системы я делал так:
<?php
$Informationsystem_Controller_Show = new Informationsystem_Controller_Show(
Core_Entity::factory('Informationsystem', 21)
);
$Informationsystem_Controller_Show
->xsl(
Core_Entity::factory('Xsl')->getByName('top1')
)
->groupsMode('tree')
->itemsForbiddenTags(array('text'))
->group(FALSE)
->itemsProperties(TRUE)
->limit(1)
//->show()
;
// Объединение с нужной таблицей свойств
$Informationsystem_Controller_Show
->informationsystemItems()
->queryBuilder()
->leftJoin('informationsystem_item_properties', 'informationsystem_items.informationsystem_id', '=', 'informationsystem_item_properties.informationsystem_id')
->leftJoin('property_value_ints', 'informationsystem_items.id', '=', 'property_value_ints.entity_id',
array(
array('AND' => array('informationsystem_item_properties.property_id', '=', Core_QueryBuilder::expression('`property_value_ints`.`property_id`')))
)
)
// Идентификатор дополнительного свойства
->where('informationsystem_item_properties.property_id', '=', 69)
// Значение дополнительного свойства
->where('property_value_ints.value', '=', '1')
->groupBy('informationsystem_items.id')
// Количество свойств
->having(Core_Querybuilder::expression('COUNT(DISTINCT `informationsystem_item_properties`.`property_id`)'), '=', 1)
;
$Informationsystem_Controller_Show->show();
?>
Но как это сделать с товарами магазина?
Заранее большое спасибо!