在Magento中将数组转换为集合 [英] Converting an array to a collection in Magento

查看:32
本文介绍了在Magento中将数组转换为集合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数组对象,它是DB的magento fetchall的输出,我希望将其转换为Collections类的对象,以便我可以实现分页并使用此集合与其他表联接.你能在这里帮我吗?现在被卡了很长时间了!

解决方案

Magento没有内置的转换器,但是您可以使用Collections编写查询,或基于数组中的所有id加载Collection. /p>

I have an array object that is an output of a magento fetchall from DB and i want this to be converted to an object of a Collections class so that i can implement pagination and use this collection to join with other tables. Can you please help me here ? been stuck for a long time now !!

解决方案

Magento hasn't a built in conversor for that, but you can write you query using Collections, or load the Collection based on all ids from your array.

这篇关于在Magento中将数组转换为集合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆