Zend 框架 TDG 与 Doctrine

2021-12-29 00:00:00 orm php doctrine zend-framework

可能的重复:
什么时候应该使用doctrine ORM,什么时候使用zend-db-table?

简而言之,什么更好,为什么?

In short, what is better and why ?

我目前使用 Zend Framework TDG,但正在考虑转向 Doctrine.

I currently using Zend Framework TDG but am considering move to Doctrine.

已经转向 Doctrine 的人(来自 Zend FW TDG)能说说这个经历吗?它是否更好、更快、更灵活,为什么我(和任何人)要转向 Doctrine,或者为什么不?

Could that someone who already moved to Doctrine (from Zend FW TDG) says the experience? Is it better, faster, more flexible, and why do I have (and anybody) move to Doctrine, or why not?

提前致谢.

推荐答案

Doctrine 比 Zend (ORM?) 灵活得多.您无法真正比​​较这两者,因为 Zend 必须关注其框架中的许多方面,而 Doctrine 仅关注其框架"的 ORM/DBAL 方面.从这种方法来看,与 ORM 中的 Zend 相比,Doctrine 将始终领先一步.

Doctrine is much more flexible then Zend (ORM?). You cannot really compare those two because Zend has to focus on many aspects in their framework and Doctrine only focusses on the ORM/DBAL side of their 'framework'. From this approach Doctrine will be always one step ahead compared to Zend in ORM.

与 ZF 相比,我喜欢 Doctrine 的一点是,您可以非常快速、简单地编写代码,而且非常灵活.像 Doctrine 命令行工具从实体更新架构、映射到关系和延迟获取、处理 DQL 中的实体(例如'FROM EntityDonation d WHERE d.user = :user' 和 :user 很简单)用户实体对象)

What I like from Doctrine compared to ZF is you can write code really fast and simple and it's flexibillity. Things like the Doctrine command line tool to update your schema from your entities, mapping to relations and lazy fetching, work with entities in your DQL (e.g.'FROM EntityDonation d WHERE d.user = :user' and :user is simple a user entity object)

AST 使您可以轻松编写自定义 TreeWalkers 以在转换为 SQL 之前操作 DQL 和查询结构,我在自己的项目 Pike_Grid 中经常使用它.

The AST which makes you easy to write custom TreeWalkers to maninpulate DQL and Query structure before converted to SQL, which I use a lot in my own project Pike_Grid.

相关文章