Eloquent like ORM for Yii
Posted 08 July 2012 - 05:16 PM
Any plans to modify Yii ORM to be more Eloquent like? I'm planning even to implement Eloquent on core level for Yii 1.1.x but I think PHP >= 5.1 limitation will make it impossible. Eloquent is one of the best ORMs in the market, it 's compared with Doctrine but is very lightweight.
I've come to yii from codeigniter, and I really want to stay with it as our team developed home-made CMS based on Yii for our clients (web studio). But I want the framework to move forward and stay up to date. Our team is ready to help with the development of Yii 2.0 as soon as the alpha will go public. We're ready to help with implementation of Eloquent ORM too on pre-alpha stages.
I'm interested what others think about Eloquent ORM and do you agree that it will be beneficial for Yii to go with it.
Link for Eloquent: http://laravel.com/d...tabase/eloquent
Posted 09 July 2012 - 10:30 AM
- Dirty attributes concept. We'll have it in Yii2.
- Interesting way of defining relations.
- AR supports saving related records. Since there are dirty attributes, implementation is relatively straightforward.
- Metadata isn't selected with records and is not used at all. Models are schemaless so you can write any property and will get SQL error only when saving it.
- There's mass assignment but they did the same mistake RoR did allowing all by default and even more by not restricting column names.
Are there more things I've missed?
Posted 20 August 2012 - 08:17 AM
I think you need to be a lot more specific about the actual features and syntax you find to be so important.
I started looking at the documentation, and the first thing I noticed was that magical static properties like $table and $timestamps are used instead of a concrete API. Definitely not something I would endorse.
I don't personally have time to try out yet another ORM. Just from a glance, I'm sure as with any ORM, some people are going to love it, and others are going to hate it.
(If you happen to have found your personal favorite, maybe you can just take the ORM and use it in Yii?)