3

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.

1

2 Answers 2

7

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.

Sign up to request clarification or add additional context in comments.

1 Comment

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 outlet-orm.org - Outlet ORM
1

Doctrine Project based on Hibernate.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.