Which PHP ORM works best with Zend Framework?

17,736

Solution 1

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

Solution 2

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.

Share:
17,736

Related videos on Youtube

Billy ONeal
Author by

Billy ONeal

Credit for Avatar image: http://www.assaultandroidcactus.com/ I'm a Microsoft Software Development Engineer on the Trustworthy Computing Team. I've worked at several security related places previously, including Malware Bytes and PreEmptive Solutions. On StackOverflow I mostly answer c++ related questions, though I occasionally forray into c# and a couple of others. I am the author of pevFind, a component of the ComboFix malware removal tool, and volunteer at BleepingComputer.com as a malware response instructor. My Twitter account is @MalwareMinigun.

Updated on June 04, 2022

Comments

  • Billy ONeal
    Billy ONeal almost 2 years

    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?

  • Billy ONeal
    Billy ONeal about 13 years
    Doctrine 2 does not seem to support nested set -> doctrine-project.org/docs/orm/2.0/en/reference/…
  • Marcin
    Marcin about 13 years
    +1. Also from what I observer at SO, combination of Doctrine + ZF seems to be more popular that Propel + ZF.
  • Sander Marechal
    Sander Marechal about 13 years
    @Billy ONeal: It does, just not out-of-the-box. The page you linked gives you two nested set implementations for Doctrine 2.
  • m4rc
    m4rc about 13 years
    Also as far as my recollection, Zend is dropping ZendDB in ZF2 in favour of using Doctrine
  • David Weinraub
    David Weinraub about 13 years
    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.
  • Billy ONeal
    Billy ONeal about 13 years
    @m4rc: Not true according to framework.zend.com/wiki/display/ZFDEV2/…
  • Billy ONeal
    Billy ONeal about 13 years
    @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.
  • Phil
    Phil about 13 years
    @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?"
  • Billy ONeal
    Billy ONeal about 13 years
    @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 ;)
  • prodigitalson
    prodigitalson about 13 years
    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
    prodigitalson about 13 years
    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...
  • Billy ONeal
    Billy ONeal about 13 years
    @Phil: Feel free to ask/answer that "why" question over here -> programmers.stackexchange.com/questions/48760/…

Related