views:

552

answers:

2

I am looking at using an ORM in PHP for the first time. Until now my PHP projects have been fairly small and an ORM seemed like overkill.

I really like NHibernate so I was hoping that there is an ORM out there for PHP that works and is configured similarly to NHibernate. If there is one with a fluent interface like Fluent NHibernate that would be even better.

Thanks.

+3  A: 

I'd recommend you take a look at Doctrine ORM. Doctrine can generate your table to PHP class mappings using YAML, which is similar to NHibernate's mappings using XML. Doctrine also provides command line tools to rebuild aspects of your data layer based on changes to either your schema, the models themselves or the database tables you're abstracting over.

I've only really looked at NHibernate, not used it. So I wouldn't claim to know precisely how well the two ORMs approaches cross-over; I'm sure a quick glance through their documentation would help you reach a better conclusion.

Kieran Hall
Just as a follow up. Docrtine turns out to be based on ActiveRecord which is not like NHibernate. The closed thing I've found is http://outlet-orm.org - Outlet ORM
modernzombie
A: 

Doctrine Project based on Hibernate.

poo