Code first Entity Framework model in PHP

Pix*_*ord 3 php model-view-controller entity-framework laravel eloquent

I am recently working in a ASP.Net MVC project where we use code first technique to create all the database table. I really liked the idea, where you don't need to touch the database and create the model classes which are automatically mapped to the database by the EF layer.

我打算使用PHP启动一个业余项目,并与Laravel一起玩(我是PHP的新手)。我想知道PHP中是否有任何等效的框架支持EF 4.1等代码优先模式?

我正在研究一些Laravel教程,看来ORM(雄辩)与.net中EF 4.1的工作方式并不完全相同。在我看来,您仍然需要在数据库中创建表,然后创建一个模型来映射数据库。我想念什么吗?

谢谢。

小智 5

对于PHP,我建议将Doctrine 2视为ORM。您定义实体,该学说将为您生成类和数据库结构。