Which of the following snippet of codes can be used to get the latest n products?

  • $collection = Mage::getModel(‘catalog/product’)->getCollection();
    $collection->getSelect()->order(‘entity_id desc’)->limit(n);

  • $collection = Mage::getModel(‘catalog/product’)->getCollection();
    $collection->getSelect()->orderBy(‘entity_id desc’)->limit(n);

  • $collection = Mage::getModel(‘catalog/products’)->getCollections();
    $collection->getSelect()->orderBy(‘entity_id desc’)->limit(n);

  • None of the above

Тупой индус взял вопрос отсюда: stackoverflow.com/a/12982366