Is there a method to do the above, or would I need to loop through the object and build an array in the usual fashion?
------
Server: *nix, ModX Evo 1.0.4, Apache 2.x, PHP 5.x, Mysql 5.x.
Yes, but what I’m getting at is a method which converts the entire result into a pure multidimensional array ...
------
Server: *nix, ModX Evo 1.0.4, Apache 2.x, PHP 5.x, Mysql 5.x.
-
MODX Staff
- 730 Posts
There is no method to do that, but you could add one, based on loadCollection.
Where loadCollection gets $rows back from the _loadRows() method, then proceeds to iterate the $rows, instantiating objects and adding them to the collection, you could change it to build up your array instead.
You might create a new class, extending xPDOObject or xPDOSimpleObject, and add your new method to that (those). Then in your own xpdo model, you could just extend your new custom classes.