Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
In Magento, a collection is a list of elements (an array). All collections are children of Varien_Data_Collection. This class implements the IteratorAggregate and Countable interfaces. IteratorAggregate allows you to use a collection in a foreach loop. A good example of a collection is a customer list (Mage_Customer_Model_Resource_Customer_Collection). This class also inherits Varien_Data_Collection_Db, which allows you to work with the database, make queries and get the result as a collection. An example of working with this collection can be found in the Mage_Customer_Model_Customer_Api method items($filters).
Collections are not Magento at all. If you think that just at first glance it seems that the collection is just some kind of "collection" of dresses, then no. A collection is an architectural element that makes it possible to conveniently work with a collection of objects by implementing methods that are not inherent in any of the objects.
UPD: devdocs.magento.com/guides/m1x/magefordev/mage-for...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question