Good PHP ORM Library?

Is there a good object-relational-mapping library for PHP?

I know of PDO/ADO, but they seem to only provide abstraction of differences between database vendors not an actual mapping between the domain model and the relational model. I'm looking for a PHP library that functions similarly to the way Hibernate does for Java and NHibernate does for .NET.


Look into Doctrine.

Doctrine 1.2 implements Active Record. Doctrine 2+ is a DataMapper ORM.

Also, check out Xyster. It's based on the Data Mapper pattern.

Also, take a look at DataMapper vs. Active Record.


Try RedBean, its requires:

  • No configuration
  • No database (it creates everything on the fly)
  • No models
  • etc.
  • It even does all the locking and transactions for you and monitors performance in the background. (Heck! it even does garbage collection....) Best of all... you don't have to write a single... line of code... Jesus this , ORM layer, saved me ass!


    There are only two good ones: Doctrine and Propel. We favor Doctrine, and it works well with Symfony. However if you're looking for database support besides the main ones you'll have to write your own code.

    链接地址: http://www.djcxy.com/p/66750.html

    上一篇: 在phpMyAdmin中设置外键?

    下一篇: 良好的PHP ORM库?