0 Replies - 10619 Views - Last Post: 20 June 2012 - 01:17 PM

#1 [RTS]BN+VS*  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 175
  • Joined: 23-March 09

ArrayObject new offsets

Posted 20 June 2012 - 01:17 PM

I have this class which derives from ArrayObject: http://pastebin.com/LrBhVxM7

It is keeping track of values in additional lookup tables so they can be quickly retrieved in certain ways. Every time and element is added to the array object, my code needs to handle it and needs to know the value being added and the offset at which it will reside. In currently have this in a method overloading offsetSet, which works nicely, except for when adding an element using $foo[] = $bar, as the offset will then be null. I'm looking for a way to better hook into the base class and use the offset value it comes up with rather then the ugly hack I put into place now (getNewOffset). Same problem occurs in append, which I still need to overload here.

Any input on this would be great appreciated :)

Is This A Good Question/Topic? 0
  • +

Page 1 of 1