Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

LIMIT query items getSelect
 
Gerda222
Jr. Member
 
Total Posts:  13
Joined:  2009-07-28
 

Hi all,

I need your help.
In this query i will LIMIT the results. But this doesn’t work. The LIMIT where ignored. Can anyone help with this problem?

$product Mage::getModel('catalog/product');
 
 
$attributes Mage::getResourceModel('eav/entity_attribute_collection')
    ->
setEntityTypeFilter($product->getResource()->getTypeId())
    ->
addFieldToFilter('attribute_code''manufacturer')
    ->
load(false);

    
$attributes->getSelect()->limit(5);

    
$attribute $attributes->getFirstItem()->setEntity($product->getResource()); 
    

    
/* @var $attribute Mage_Eav_Model_Entity_Attribute */
    
$manufacturers $attribute->getSource()->getAllOptions(false);

Many thanks for any help!

Regards

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top