+ Reply to Thread
Results 1 to 4 of 4

Thread: Any1 got a quick and dirty ORM for 1.5?

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

    Post A quick and dirty ORM for 1.5

    In 1.0 I've overloaded the _fetch method to join tables to create an ORM-like app. I only really need this in one place so I don't wan't to change my app to Doctrine.

    What I have is in theory simpe:

    Customer database - contains customer id
    -- Company database - contains company specific data
    -- Person database - contains person specific data

    Since the customer id is the same this seems like a good way of doing it. All I do is a join() where the company or person data are stored in a different var which is then also searched when the __get, save etc methods are called. Worked nicely until the _fetch got fundamentally changed...

    I've looked at different ORM proposals but all efforts seem to have died off...

    Pleaze share with me your dirty hack on how to solve this until the devs come up with an orm.

    Thanks!
    Last edited by mgordon; 03-13-2008 at 01:01 PM.

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

    Default

    Ok, I've put together the attached class, not as quick as I hoped but pretty dirty. Got a little bigger than the max allowed txt...

    This is my novice aproach to an ORM - Object-Relational mapping database object. Please give hints on howto make the class safer for future changes. Any hints are appreciated.
    Last edited by mgordon; 02-24-2008 at 11:32 AM.

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

    Smile Update to the table

    So far u can only have inheriting tables but it seems to work nicely. See the .3 version.
    Attached Files
    Last edited by mgordon; 03-13-2008 at 12:59 PM.

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

    Default

    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

+ Reply to Thread

Similar Threads

  1. Zend quickstart is not very quick for me
    By motorpoodle in forum General Q&A on Zend Framework
    Replies: 2
    Last Post: 08-12-2010, 01:07 AM
  2. Quick Start Tutorial parse error
    By imatua in forum Installation & Configuration
    Replies: 3
    Last Post: 05-01-2009, 06:44 PM
  3. Quick way to get submit buttons side by side?
    By sosh in forum General Q&A on Zend Framework
    Replies: 1
    Last Post: 03-02-2009, 07:29 AM
  4. quick q
    By cantona in forum General Q&A on Zend Framework
    Replies: 2
    Last Post: 09-11-2008, 11:01 AM
  5. quick question about views
    By warden in forum General Q&A on Zend Framework
    Replies: 1
    Last Post: 12-08-2007, 05:31 PM

Posting Permissions

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