9

Well, seeing as I'm dissatisfied with Zend_Db_Table after being spoiled by LINQ, I'm looking to get started learning an ORM with PHP. General consensus seems to be that Doctrine and Propel are the only good ones for serious use -- and whatever my opinion, I'd like to use something at least moderately popular so that people in the future can look at this app I'm working on without having an head explosion :P

I'm currently leaning towards Propel because it's documentation seems to be a bit more complete, and it supports the nested set model (also called "modified preorder tree transversal model") right out of the box. However, I like Doctrine's use of namespaces and other PHP 5.3 features, and it seems to be a bit more popular.

From those who have used either ORM with Zend Framework, which meshes better with the existing framework (if either)? What kind of issues should I watch out for using either framework with Zend?

Community
  • 1
  • 1
Billy ONeal
  • 104,103
  • 58
  • 317
  • 552

2 Answers2

10

I can't speak for Propel but there are a lot of good integration resources for ZF and Doctrine. See Zend Framework 1.11 with Doctrine 2 Integration

Community
  • 1
  • 1
Phil
  • 157,677
  • 23
  • 242
  • 245
  • +1. Also from what I observer at SO, combination of Doctrine + ZF seems to be more popular that Propel + ZF. – Marcin Feb 16 '11 at 06:38
  • Also as far as my recollection, Zend is dropping ZendDB in ZF2 in favour of using Doctrine – m4rc Feb 16 '11 at 08:13
  • 1
    @m4rc: Not true according to http://framework.zend.com/wiki/display/ZFDEV2/Zend+Framework+2.0+Requirements – Billy ONeal Feb 16 '11 at 19:24
  • @Phil + @Marcin: Do you think that is the result of Doctrine working better with ZF specifically, or the fact that Doctrine is more popular in general? It seems that most of the things people complain about with Propel were fixed in 1.5, and it certainly is a lot less complicated than Doctrine -- but does have the downside of the code generation step. – Billy ONeal Feb 16 '11 at 19:26
  • @Billy I get the feeling the ZF and Symfony / Doctrine guys hang out a lot (at least in virtual spaces). If Doctrine is more popular, perhaps the real question is "why?" – Phil Feb 16 '11 at 21:53
  • @Phil: Not sure. Propel earlier than 1.5 is indeed bad to look at. But since 1.5 was released it seems everyone was still on the doctrine bandwagon. I don't want to just "get on the bandwagon" though ;) – Billy ONeal Feb 17 '11 at 00:47
  • Well i get the impression Doctrine2 is the bees-kness right now because Data Mapper is a very popular pattern right now, while many curse Active Record. Matthew from ZF is all about it - implementing DM is even outlined in the ZF quickstart. I think for Symfony its a matter of Doctrine being blessed as the official ORM and so Doctrine2 by default is the ORM for Symfony2... Not to mention JWage was on the core Symfony team and a Sensio employee... – prodigitalson Feb 17 '11 at 02:38
  • I think the other important aspect is a desire to decouple Models from DB abstraction... which i think is the core reason DM is being pushed by the enterprise focused frameworks. Additionally i think the desire for Propel2 is actually to build an Active Record implementation using Doctrine2 DBAL... – prodigitalson Feb 17 '11 at 02:40
  • @Phil: Feel free to ask/answer that "why" question over here -> http://programmers.stackexchange.com/questions/48760/should-i-choose-doctrine-2-or-propel-1-5-1-6-and-why – Billy ONeal Feb 17 '11 at 17:37
1

Well Doctrine 1.2 supports Nested Set... much better than propel did in < 1.3. I havent used propel 1.4/5 so i cant comment on its current state. I also havent used Doctrine 2... ive been sticking with 1.2 since mot of my projects dont use php 5.3...

Overall I liked Propel better... I prefer generated classes to ones configured dynamically at runtime. Also keep i mind Propel is an active record implementation while Doctrine 2 uses the Data Mapper pattern.

prodigitalson
  • 60,050
  • 10
  • 100
  • 114
  • Doctrine 2 does not seem to support nested set -> http://www.doctrine-project.org/docs/orm/2.0/en/reference/limitations-and-known-issues.html#nested-set – Billy ONeal Feb 16 '11 at 05:32
  • @Billy ONeal: It does, just not out-of-the-box. The page you linked gives you two nested set implementations for Doctrine 2. – Sander Marechal Feb 16 '11 at 07:10
  • 1
    I'm drawn to Doctrine2 precisely because it's DataMapper-ish. I find ActiveRecord- even a great one like Doctrine1 - feels funny to me, too close to Zend_Db_Table. – David Weinraub Feb 16 '11 at 14:19