开发者

Getting as an array rather than a DataMapper ORM collection object

开发者 https://www.devze.com 2023-02-27 06:09 出处:网络
I am using the DataMapper ORM in my CodeIgniter project. The problem I am having is, when I use the following codes:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消