Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. public static function getAllDataFromTable()
  2. {
  3. $model = Mage::getModel('custom/table');
  4. $collection = $model->getCollection();
  5. $array = array();
  6. foreach ($collection as $item) {
  7. $array[] = $item->getData();
  8. }
  9. return $array;
  10. }
  11.  
  12. /**
  13. * Mage_Core_Model_Resource_Iterator
  14. */
  15. public function getAllDataFromTable()
  16. {
  17. $ordersCollection = Mage::getModel('custom/table')->getCollection();
  18. Mage::getSingleton('core/resource_iterator')->walk($ordersCollection->getSelect(),
  19. array(array($this, 'orderCallback'))
  20. );
  21. }
  22.  
  23. public function orderCallback($args)
  24. {
  25. return $args['row'];
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement