Re: [PHP] Re: Simplest way of enforcing an array of instances of a specific class but treating the whole thing as an array.

2011-02-25 Thread Richard Quadling
On 24 February 2011 18:28, David Harkness davi...@highgearmedia.com wrote: If each array will contain a single type of object, but you need many of these arrays, each containing a different type of object, I recommend creating a generic instances-of-class array using ArrayObject. You can

[PHP] Re: Simplest way of enforcing an array of instances of a specific class but treating the whole thing as an array.

2011-02-24 Thread Richard Quadling
On 24 February 2011 12:43, Richard Quadling rquadl...@gmail.com wrote: Hi. Brain being a little slow today. My objective is to enforce a parameter to a method to be an array of a specific class (or null). The specific class is LatLng. I want to be able to pass an array of LatLngs to a

Re: [PHP] Re: Simplest way of enforcing an array of instances of a specific class but treating the whole thing as an array.

2011-02-24 Thread David Harkness
If each array will contain a single type of object, but you need many of these arrays, each containing a different type of object, I recommend creating a generic instances-of-class array using ArrayObject. You can enforce the type in append(), offsetSet(), and exchangeArray() and then check the