SitePoint Sponsor

User Tag List

Results 1 to 25 of 25

Thread: Php Orm

  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    Sydney
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Php Orm

    Just wanted to start a thread to list all the available PHP ORM solutions.

    There are a few threads which all almost the same and have links to available solutions, but they're all over the place. Much like the list of templating engines a while back, this will be focusing on PHP (4 and 5) ORM solutions.

    No more list here.

    ORM at wiki.cc
    Last edited by dylanegan; Mar 15, 2005 at 22:25.

  2. #2
    eschew sesquipedalians silver trophy sweatje's Avatar
    Join Date
    Jun 2003
    Location
    Iowa, USA
    Posts
    3,749
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dylanegan
    Changes (By Marcus) [Marcus, did you have it available on a site I could link to?]
    Were you looking for this?
    Jason Sweat ZCE - jsweat_php@yahoo.com
    Book: PHP Patterns
    Good Stuff: SimpleTest PHPUnit FireFox ADOdb YUI
    Detestable (adjective): software that isn't testable.

  3. #3
    SitePoint Addict
    Join Date
    May 2003
    Location
    Calgary, Alberta, Canada
    Posts
    275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dylanegan
    Metastorage (?)
    EZPDO (PHP5)
    Propel (PHP5) [Uses Creole]
    Changes (By Marcus) [Marcus, did you have it available on a site I could link to?]
    PHP5 port of Changes [A release sometime soon, working on better PgSQL support and touching up the current MySQL. It uses PDO]
    In addition to those there is:
    MyObjects
    Pear DB_DataObject
    Entity

    The features vary greatly for each product. There is quite alot of difference.

    Ive started working on something aswell. Its in the very early stages and is linked in my sig.

  4. #4
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    Sydney
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sweatje
    Were you looking for this?
    Sort of. Hoping Marcus puts something up on his site.

    Thanks for the others, will update list.

  5. #5
    SitePoint Wizard
    Join Date
    Aug 2004
    Location
    California
    Posts
    1,672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The features vary greatly for each product. There is quite alot of difference.
    Perhaps some industrious person could build a feature matrix to compare them. Actually, if a person knowledgable about each could post its features perhaps we could probably build a basic feature matrix from that.

    Here is what some of the projects list as their features:

    Metastorage features
    * Easy to write and understand component model definition format in XML
    * Automatic generation of (database) schema for the persistence container
    * Automatic generation of all classes: data classes, factory class and (database) schema installation class
    * All code is generated without the need for the developer to write SQL code manually
    * A powerful Object Query language lets the developer specify arbitrary search conditions with the same level of complexity as with SQL.
    The object queries are pre-compiled and embedded in the generated code to maximize the query execution performance.
    * The generated code is very compact. Metastorage performs extensive analysis to only include code that will be actually used according to the type of operations that the developer wants the generated classes to execute.
    * The generated code is self-contained and so it does not depend on MetaL or libraries of code that are not supplied
    * Generation of classes to create, validate and process Web forms to manage objects of the data classes.
    * Automatic generation of Entity-Relationship graphs in UML of the component class diagram

    EZPDO
    * Minimum SQL knowledge required
    * Requires minimum ORM specification
    * No Phing! No need of explicit command line compile
    * Works with existing code and database
    * Has a small runtime core to guarentee performance
    * Handles 1:N, and M:N relationships automatically
    * Provides a simple runtime API
    * Supports object query (EZOQL)
    * Auto generates database tables
    * Test-driven with continuous integration

    Propel Features
    * Easily extensible. Use of XML schemas makes it possible to easily integrate with other components driven by your data model (e.g. a form generation tool could also use the same XML schema) or to extend the schema definition to include attributes for other components (e.g. more validation informat for that form tool).
    * Easily customizable. The generated object model is built to be customized. All internal calls are made to empty stub classes which extend the classes with generated logic. You can override behavior in the stub classes or provide your own custom business logic without sacrificing the ability to rebuild your object model at a later time.
    * Plays nice. This is a way of saying that Propel doesn't force you to use only Propel tools. For example, while you can use the Criteria objects to construct queries without writing SQL, we recognize that Criteria doesn't do everything and so we've also made it easy to use custom SQL to populate generated objects.
    * Truly independent. The use of a build process to create customized SQL and PHP classes means that your database interactions with Propel are truly database-independent -- taking advantage of the strenghts of your RDBMS and providing emulation for things your RDBMS doesn't support (e.g. fkey cascading deletes in MySQL). Tools are also provided to easily move data from one RDBMS to another.
    * Intuitive, Predictable. Propel's data model definition is follows very closely the structure of the underlying database. This provides the advantage of making Propel easy to understand and also of behaving predictably with very complex data models.
    * Advanced. Propel makes the difficult relational problems easy and efficient. For example, Propel provides the ability to populate related (foreign key) objects from a single query. Propel also supports basic (table per class tree) inheritance and other advanced OO features.

    DB_DataObject
    * Build SQL and execute statements based on the objects variables.
    * Group source code around the data that they relate to.
    * Provide a simple consistent API to access and manipulate that data.
    * A common simple configuration method (for setting database connections)
    * A fast and simple store for database descriptions, so primary keys can be used to locate data quickly
    * a debugger that enables you to see what exactly it is doing.
    * basic data validation - so the strings and integers can be checked.
    * Posibility to build complex joins or get related data by secondary calls (links) .
    * Ability to create and update your Table specific classes with the current database table variables (see autobuilding)
    * Simple to integrate with other packages, with setFrom() and toArray() methods
    Christopher

  6. #6
    SitePoint Addict
    Join Date
    Apr 2004
    Location
    Melbourne
    Posts
    362
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I actually got around to making a more concise list for Entity:

    * All entities mapped to the same database tables: 1 for storing information about the class, 1 for storing all the properties of the class (this has since been broken down into a database table to map to each property type, which is all handled internally).
    * Automatically generated editing interfaces for view, edit and administration actions (easy to customise views)
    * Simple API for creating, saving, loading and relating entities (no SQL needed)

    $book = ClassManager::createObject('Book');
    $book ->name = 'The Gunslinger';
    $book ->saveObject();

    $author = ClassManager::createObject('Author');
    $author->name = 'Stephen King';
    $author->saveObject();

    $book->linkTo($author->objectId());

    // Load the author into a new object
    $reloadedAuthor = ClassManager::loadObjectById($author->objectId(), 'rw');
    * *nix based permission system allowing for user group and world permissions to be set
    * Simple but powerful methods for querying and finding entities
    * Tree structure provides recognizable heirachical view of entities
    * MySQL and SQLite support
    * Predefined entity types.

  7. #7
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  8. #8
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    Sydney
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for all the info.

    Might be a better idea to move this to wiki.cc considering the list is a lot bigger than I first imagined, plus the thread will become enormous if we include feature lists, reviews, etc.

  9. #9
    ********* Victim lastcraft's Avatar
    Join Date
    Apr 2003
    Location
    London
    Posts
    2,423
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi...

    Quote Originally Posted by dylanegan
    Might be a better idea to move this to wiki.cc considering the list is a lot bigger than I first imagined, plus the thread will become enormous if we include feature lists, reviews, etc.
    I think that would make for a very good thread. You are more likely to elicit a warts and all review on a forum than on a wiki I think.

    yours, Marcus
    Marcus Baker
    Testing: SimpleTest, Cgreen, Fakemail
    Other: Phemto dependency injector
    Books: PHP in Action, 97 things

  10. #10
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    Sydney
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, does make sense.

    Well the thread is still open. So if the authors of some of these projects or the users would be able to write up a single post one basic use and overall comfort it would be great. Most likely users should be doing the reviewing to make sure there is no bias.

    Just amazed at how many there are. Good way to save time by implementing ideas from each other. And even better that they're spread between PHP4 and PHP5.

  11. #11
    SitePoint Member
    Join Date
    Mar 2005
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for initiating the thread and the idea of starting a wiki. That will be really helpful for the users. I would be happy to help out with the EZPDO materials. We have just summarized the latest improvements and plans before the official 1.0 release in the coming month.

  12. #12
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    Sydney
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by nauhygon
    Thanks for initiating the thread and the idea of starting a wiki. That will be really helpful for the users. I would be happy to help out with the EZPDO materials. We have just summarized the latest improvements and plans before the official 1.0 release in the coming month.
    If you could you can document bits of your app over on the wiki, just create a page for EZPDO and put a link next to it on the ORM page. Also head to http://wiki.cc/php/Documentation and add a link to your page there if you could.

  13. #13
    SitePoint Member
    Join Date
    May 2003
    Location
    Laval
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,
    I looking for an object persistance product for a project I'm working on. I cheked all of the software mentionned above and Propel seems the more appealing. However, it looks like it does not handle inheritance very well as it requires all the fields of the sub classes to be in the table for the base classe (even if the base class doesn't need them).

    Basically, we have a "Server" class which should be mapped to a "servers" table and which has some properties. Then we have a "LinuxServer" class which inherit from the "Server" class. I'm looking for a product that would allow me to have a "servers" table containing all the properties of the "Server" class and a "linux_servers" table which would contain only the properties of "LinuxServer" which are not covered by the "server" table.

    Does any of the above mentionned products fullfills this requirement ?

    Thanks for your help.

  14. #14
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it seems to be a problem with all the currently available orm-api's for php that they are table-centric, and thus doesn't hande inheritance very well. i'm not sure, but i think that ezpdo may be supporting this kind of mapping. anybody who can verify this ?

  15. #15
    SitePoint Addict
    Join Date
    May 2003
    Location
    Calgary, Alberta, Canada
    Posts
    275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kyberfabrikken
    it seems to be a problem with all the currently available orm-api's for php that they are table-centric, and thus doesn't hande inheritance very well. i'm not sure, but i think that ezpdo may be supporting this kind of mapping. anybody who can verify this ?
    EzPdo doesnt support this. Ive never come across any php ORM's that support any of the inheritance mapping patterns.

    EDIT:
    Actually Perdure (see signature) probably supports this. Perdure on a whole may be too immature to use in a production environment at this time though. The only QA it has had is the tests.

    For perdure the mapping file would need to look like:
    PHP Code:
    <persistence>
      <class 
    name="Server" table="servers">
        <
    field name="id" type="int" column="server_id" dbtype="INT(10)">
          <
    id/>
        </
    field>
        <
    field name="name" type="string" column="server_name" dbtype="VARCHAR(64)"/>
      </class>
      <class 
    name="LinuxServer" table="servers">
        <
    field name="id" type="int" column="server_id" dbtype="INT(10)">
          <
    id/>
        </
    field>
        <
    field name="name" type="string" column="server_name" dbtype="VARCHAR(64)"/>
        <
    field name="linuxSpecialColumn" type="string" column="linux_special" dbtype="VARCHAR(64)"/>
      </class>
    </
    persistence
    Last edited by Brenden Vickery; Apr 21, 2005 at 13:53.

  16. #16
    SitePoint Member
    Join Date
    Mar 2005
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kyberfabrikken
    i'm not sure, but i think that ezpdo may be supporting this kind of mapping. anybody who can verify this ?
    It requires a bit extension in the @orm tag syntax to support this. For example, in the class level @orm tag, we may have something like this?
    Code:
    @orm ... exclude_superclass
    We will make a note (feature request) for future releases. I speculate it will be in post-1.x versions.

  17. #17
    SitePoint Member
    Join Date
    May 2003
    Location
    Laval
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks all for your replies. Could you please explain a bit how to do it with ezpdo with exclude_superclass ?

    Thanks.

  18. #18
    SitePoint Member
    Join Date
    Mar 2005
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by illogix
    Thanks all for your replies. Could you please explain a bit how to do it with ezpdo with exclude_superclass? Thanks.
    illogix, this is something we'd like to have in the future release (post 1.x as i indicated in my reply). not implemented yet. keep bugging us if you want it badly so we may be able to adjust our priorities.

    back to your problem. not sure how important it is for you to avoid mapping the superclass. for now, if you use EZPDO, the only cost of not excluding the parent class is some wasted columns in the table. not optimal in terms of storage efficiency, but perhaps it doesn't matter much if you are not dealing with large tables (that have many columns).

    hope it helps.

  19. #19
    SitePoint Member
    Join Date
    May 2003
    Location
    Laval
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK Thanks.

    Well that's the problem. We have multiple subclasses and each one has more than 20 fields.

    I guess I'll have to do the object mapping by hand.

    Thanks for your help.

  20. #20
    SitePoint Member
    Join Date
    Mar 2005
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile

    Quote Originally Posted by illogix
    Well that's the problem. We have multiple subclasses and each one has more than 20 fields. I guess I'll have to do the object mapping by hand.
    well, having been working on ORM for a while, I just can't see people trying to map manually.. that's just too depressing for me. :-)

    wondering the reason of excluding the superclass. if you don't want the data members to be persisted for all the subclasses, you simply don't insert any @orm tags (assuming EZPDO is used).

    is it possible that you replace inheritence with composition/association? see if this gives you any useful ideas.
    Last edited by nauhygon; Apr 22, 2005 at 06:44.

  21. #21
    SitePoint Addict
    Join Date
    May 2003
    Location
    Calgary, Alberta, Canada
    Posts
    275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Brenden Vickery
    Actually Perdure (see signature) probably supports this.
    I posted this in too much of a rush and I was wrong. The mapping I posted is for single table inheritance. You are looking for class table inheritence and Perdure cant do this at this time.
    Last edited by Brenden Vickery; Apr 21, 2005 at 23:07.

  22. #22
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    Sydney
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I write PPO and I would be interested in adding this feature. I think it would be very easy to implement, hopefully I can get around to it soon.

  23. #23
    SitePoint Member
    Join Date
    Sep 2005
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Propel ORM

    Hi everyone, i am a student of information Systems and i would like to know
    how to use propel to model many to many relationships.furthermore
    i need sample codes to be able to know how to retrieve from propel...
    i have a database consits of persons and images table which are all related to each other or some are related to a specific number of people in the table...

    i want to retrieve all people even indirectly related to say person x..
    and person x is related to P2 and p2 to p3 and so on.so i need to retrieve all
    these persons.in the above scenario person p3 is indirectly related to x,the query should also not neglect the other related persons...

    can such a complex query be done in propel.....
    if so could someone help me out please........

  24. #24
    SitePoint Addict
    Join Date
    Apr 2002
    Posts
    330
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Brenden Vickery
    Quote:
    Originally Posted by dylanegan
    Metastorage (?)
    Metastorage generates code that works on PHP 4 and PHP 5.
    Manuel Lemos

    Metastorage - Data object relational mapping layer generator
    PHP Classes - Free ready to use OOP components in PHP

  25. #25
    SitePoint Member
    Join Date
    Sep 2005
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    help on installing propel under windows

    i would like to know how to configure and install propel under windows xp....
    am using wamp also to run php scripts....so anyone can help me out please how to merge propel and wamp.....i had a look at bthe guide am a bit lost coz am a newbie in linux....


Bookmarks

Posting Permissions

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