2

I am not being able to figure out how to get the first item in this type of collection: Varien_Data_Tree_Node_Collection

without knowing the key, is this possible?

Marty Wallace
  • 5,631
  • 13
  • 65
  • 90

1 Answers1

2

Class Varien_Data_Tree_Node_Collection implements ArrayAccess. Try to use

 reset($varienCollection);  //to reset the internal array pointer
 $firstElement = current($varienCollection);
oleksii.svarychevskyi
  • 5,136
  • 1
  • 16
  • 22