Yii Framework Forum: Eloquent like ORM for Yii - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Eloquent like ORM for Yii

#1 User is offline   Arman Poghosyan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 21
  • Joined: 24-March 12

Posted 08 July 2012 - 05:16 PM

Those who are aware of Laravel framework definitely know what the beast is Eloquent and how much elegant it is.

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

#2 User is offline   CeBe 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 572
  • Joined: 16-July 10
  • Location:Berlin. Germany

Posted 08 July 2012 - 05:21 PM

Have you seen Qiangs post about AR in yii 2.0 ?

I think it is quite similar to what you suggested...
If not, please point out differences :-)

#3 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,225
  • Joined: 17-January 09
  • Location:Russia

Posted 09 July 2012 - 10:30 AM

I've reviewed it about 2 months ago. That's what I've found out:

Good parts
- 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.

Bad parts
- 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?
Yii 2.0 Development Cookbook

Enjoying Yii? Star us at github

Support me so I can work more on Yii: https://www.patreon.com/samdark

#4 User is offline   mindplay 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 397
  • Joined: 03-September 09
  • Location:New York

Posted 20 August 2012 - 08:17 AM

View PostArman Poghosyan, on 08 July 2012 - 05:16 PM, said:

Any plans to modify Yii ORM to be more Eloquent like?

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?)

Share this topic:

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users