ORM for PHP like .NET Entity Framework

I am a .NET developer and new to PHP. I want to know if there is ORM for PHP like Entity Framework in Microsoft.NET Framework?

Are there any utilities to simplify working with data?

+8
database php orm entity-framework
source share
3 answers

I would recommend you take a look at Doctrine ORM. Doctrine can generate a table for PHP class mappings using YAML, which is similar to NHibernate mappings using XML. Doctrine also provides command-line tools for restoring aspects of your data layer based on changes to either your schema, or the models themselves, or the database tables that you abstract.

I only looked at NHibernate but did not use it. Therefore, I would not say that I know exactly how well both ORMs fit the transition; I am sure that a quick look at their documentation will help you achieve a better result.

+7
source share

A good alternative that implements a modern approach to storing data in PHP can be found in Agile Data . It used to be part of the Agile Toolkit ( http://www.agiletoolkit.org ), but now it has been reorganized into an offline environment.

+1
source share

I don't like Doctrine, instead I use DataMapper , which is lightweight (much lighter than Doctrine).

I believe this is more efficient and easy. Because it is used with CodeIgniter, the CodeIgniterand DataMapper transactions are the same.

In DataMapper you do not need to create fields in your model manually. Therefore, if you add any fields to the table, you do not need to change your models.

0
source share

All Articles