我是zend框架中的新手 我想在zend框架中使用相同的功能,如递归,我在蛋糕php中使用。 任何人都可以帮我在zend框架中实现这个? 谁知道如何在zend框架中实现相同的东西?
答案 0 :(得分:0)
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时立即使用它。 :)你最好用香草ZF做的事情就像 findDependentRowset()或 findParentRow()。
ZF给你构建你需要的工具不像其他人那样是黑盒子框架。但是,通常不会很难使用库和第三方工具。