1

Does any know how to access this huge nested array?

I’m doing a print_r to come up with this result.

Please look on the image attached to see what I’m referring.

enter image description here

For example I would like to access the entity_id in that array.

How would I do that?

Thanks.

PinoyStackOverflower
  • 5,214
  • 18
  • 63
  • 126

2 Answers2

3

extend this class

class Foo extends Mage_Catlog..........
{
public function getEntityId()
{
return $this->_ddlCatch[1]['sales_flat_quote']['entity_id'];
}

}

Mr Coder
  • 8,169
  • 5
  • 45
  • 74
  • @rakeshS extend "Mage_Catlog_Model_Resource_Eav_Attribute" since the name of class was long so I used dots instead. – Mr Coder Sep 22 '11 at 03:33
  • How does this work? Since the variable `_ddlCatch` is inside the object-variable `Mage_Catlog_Model_Resource_Eav_Attribute::_entity::_read::_ddlCatch` (sorry don't interpret the approach, just a representation). I am just curios to know, can you get a working example and show me how? You could use [Codepad](http://codepad.org/) – Rakesh Sankar Sep 22 '11 at 05:22
2

The "_entity", "_read", and "_dllCache" objects are protected, hence you can't access them. However, it seems someone has found a hack to exploit eval: OO PHP protected properties not available in foreach loop?

Community
  • 1
  • 1
Candide
  • 30,469
  • 8
  • 53
  • 60