像Zend框架中的CakePHP递归选项 [英] Recursive option like CakePHP in zend framework

查看:267
本文介绍了像Zend框架中的CakePHP递归选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新的zend框架
我想在Zend框架中像递归我在蛋糕php中使用相同的功能。
任何人都可以帮助我在zend框架中实现这个?
有人知道如何在zend框架中实现相同的功能吗?

i am new in zend framework i want the same functionality in zend framework like recursive which i am using in cake php. any one can help me to implement this in zend framework ? anyone know how to implement the same thing in zend framework ?

推荐答案

The recursive property defines how deep CakePHP should go to fetch associated model data via find(), findAll() and read() methods.
Imagine your application features Groups which belong to a domain and have many Users which in turn have many Articles. You can set $recursive to different values based on the amount of data you want back from a $this->Group->find() call:
Depth   Description
-1  Cake fetches Group data only, no joins.
0   Cake fetches Group data and its domain
1   Cake fetches a Group, its domain and its associated Users
2   Cake fetches a Group, its domain, its associated Users, and the Users' associated Articles
Set it no higher than you need. Having CakePHP fetch data you aren’t going to use slows your app unnecessarily. Also note that the default recursive level is 

如果这是你所问的,你可以拥有它或者只要你编码或者安装一个像Doctrine这样的ORM就行了。 :)你可能用vanilla做的最好的ZF就像findDependentRowset()或 findParentRow()一样。
ZF给你工具来构建你所需要的东西,而不是像其他一些黑盒子风格的框架。但是,通常不会很难锁定库和第三方工具。

If this is what you are asking about, you can have it or something like it as soon as you code it or install an ORM like Doctrine. :)
The best you're likely to do with vanilla ZF is something like findDependentRowset() or findParentRow().
ZF gives you the tools to build what you need it's not a black box style framework like some others. However it's usually not to hard to bolt on libraries and third party tools.

这篇关于像Zend框架中的CakePHP递归选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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