I would like to access any element of a magento collection by its "index". i know that i can sort magento collections and filter them by calling $collection->addFieldToFilter()
and $collection->setOrder()
so if I set the order and I know how many elements I have is there a way to access the elements randomly? I would assume the functionality exists given that there are methods for getFirstItem
and getLastItem
.
The context of my problem is that i would like to be able to access up to ten elements back into a history of entries that are saved to the database, think command line with up and down arrow keys