开发者

ORM for PHP like .NET Entity Framework [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discu开发者_运维问答ssion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 10 years ago.

I'm a .NET developer and new in PHP. I want to know, is there a ORM for PHP like the Entity Framework in the Microsoft .NET Framework?

Are there any utility applications to make working with data faster and easier?


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.


A good alternative that implements a modern data persistence approach in PHP can be found in Agile Data. It used to be part of Agile Toolkit (http://www.agiletoolkit.org), but now it's refactored into a stand-alone framework.


I do not like Doctrine, instead I use DataMapper, which is light weight (much lighter than Doctrine).

I find it to be more efficient and easy. Since it is used with CodeIgniter, the CodeIgniterand DataMapper's transactions are same.

In DataMapper you do not have to create fields in your model by hand. So if you add any fields in the table, you don't have to change your Models.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜