开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜