Getting as an array rather than a DataMapper ORM collection object
I am using the DataMapper ORM in my CodeIgniter project.
The problem I am having is, when I use the following codes:
$o = new Object();
$o->get();
The $o
becomes a DataMapper ORM collection obje开发者_如何学编程ct rather than an array.
I know I can still use foreach
to loop through the collection but other PHP array functions (such as array_pop
,array_splice
) still can not be used on it.
I would like to know if there is any function provided by DataMapper ORM to return it as an array.
Many thanks to you all.
Use DataMapper's $o->all
property instead of the $o->get()
method to return an array.
精彩评论