Propel - fetchArray 或 toArray
在 Doctrine 中,我可以使用函数 fetchArray() 而不是执行或 toArray()。我无法为 Propel 建立等效的这些功能。这可能吗?
In Doctrine i can use function fetchArray() instead of execute or toArray(). I can't founded equivalent these function for Propel. Is this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果你确实需要数组,你可以随时使用旧的 Peer API
if you really need array you can always use old Peer API
您可以在
->find()
之后调用toArray()
。要么一次:
要么循环:
You can call
toArray()
just after->find()
.Either at once:
Or in a loop:
您可以像使用数组一样迭代 propel 结果集
http:// /www.propelorm.org/documentation/03-basic-crud.html#collections_and_ondemand_Hydration
You can iterate over a propel result set like you can with an array
http://www.propelorm.org/documentation/03-basic-crud.html#collections_and_ondemand_hydration