+ Reply to Thread
Results 1 to 9 of 9

Thread: Zend and ORM

  1. #1
    D@ Mick is offline Junior Member
    Join Date
    Sep 2007
    Posts
    3

    Default Zend and ORM

    Hi all,

    I'm fairly new to the Zend framework (not to PHP though). After reading and coding a lot experimenting with Zend_Translate and the MVC capabilitiet and wanted to start with the DB oportunities. But I can't seem to find some examples to go for an ORM approach using DB's.

    I could be totally wrong, but as I said, I'm fairly new to the Zend framwork and at the same time, I'm learning Ruby On Rails so I thought things like ORM and Active Record would be the same in both framworks.

    So, hopefully a good soul can help my troubled mind

    Thx in advance

  2. #2
    Leif.Högberg is offline Member
    Join Date
    Aug 2007
    Location
    Sweden
    Posts
    52

    Default

    As far as I know there are no ORM in ZF. Personally I use propel 1.3 (propel.phpdb.org) and it works just fine together with ZF.

  3. #3
    D@ Mick is offline Junior Member
    Join Date
    Sep 2007
    Posts
    3

    Default

    Thats to bad I think. ORM functionality would be top of the bill and would give more web developers a push in the back to use PHP for their dynamic web apps.

    Becouse I have seen a change in this matter. A lot of companies prefere .NET and even ruby on rails above PHP. So Zend still has a long way to go with the framework.

  4. #4
    Vladev is offline Junior Member
    Join Date
    Oct 2007
    Posts
    3

    Default

    Actually ZF has ann ORM - Zend_Db_Table, but this is not an implementation of Active record as it is with rails, but Table/Row data gateway design pattern.
    Also, because ZF is a component framework using some of the existing solutions is very easy. Just stick doctrine or propel in you lib directory and you have an ActiveRecord based ORM solution.

    (not 100% sure, but about 99% )

    Regards

  5. #5
    mgordon is offline Junior Member
    Join Date
    Sep 2007
    Location
    Stockholm, Sweden
    Posts
    29

    Default My ORM-hack

    I've created an ORM, it's not beautiful but it serves my purposes: Any1 got a quick and dirty ORM for 1.5?

  6. #6
    xentek is offline Senior Member
    Join Date
    Feb 2008
    Posts
    112

    Default

    Vladev beat me too it, but here's some further reading in case you want to be able tell your design patterns apart:

    P of EAA: Table Data Gateway
    P of EAA: Row Data Gateway
    P of EAA: Active Record
    Object-relational mapping - Wikipedia, the free encyclopedia

    There has been some talk about adding an active record implementaiton in the framework, but I don't see how the lack of active record should keep anyone from not building a robust application with ZF.

    And for all the praise rails has recieved lately, many of its design pattern implementations are not ideal, or even an example of best practice. Its a great framework, don't get me wrong, but Zend is not going to be swayed by what the cool kids are doing. The vision they have for ZF - and the approach they are taking with coding to that vision - is quite deliberate. This means that once ZF finally matures, it will be one hell of a force to be reckoned with - in my opinion.

    If you want a rails like experience, try CakePHP (which I also like).

  7. #7
    joshteam is offline Junior Member
    Join Date
    May 2008
    Posts
    2

    Default Quick & Dirty ORM

    Here is a tutorial/write up I did on a very simple ORM I wrote for 1.5

    Zend_Db_Table with Normalized Tables Joshteam’s Weblog

  8. #8
    Echo is offline Junior Member
    Join Date
    May 2008
    Posts
    1

    Default

    Maybe you'll be interested by this proposal : Zend_Generator_Orm

  9. #9
    zsamer is offline Junior Member
    Join Date
    Jan 2008
    Posts
    7

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts