Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the ORM used by yii?

Did they implement it themselves?

like image 860
yii Avatar asked Apr 27 '10 08:04

yii


3 Answers

Their ORM seems to be called Yii Active Record.

like image 81
Pekka Avatar answered Oct 05 '22 23:10

Pekka


From Yii Site

And Yii Active Record (AR), implemented as a widely adopted Object-Relational Mapping (ORM) approach, further simplifies database programming. Representing a table in terms of a class and a row an instance, Yii AR eliminates the repetitive task of writing those SQL statements that mainly deal with CRUD (create, read, update and delete) operations.

This is the documentation about AR: www.yiiframework.com/doc/guide/database.ar This is the documenation API: http://www.yiiframework.com/doc/api/1.1/CActiveRecord

I really like it. I use Yii since a couple of year and I think that AR is very fast :)

like image 42
StErMi Avatar answered Oct 05 '22 22:10

StErMi


Yii ORM is called "Active Record" is mostly inspired by Ruby on Rails Active Record (even if the "Active Record pattern" is used in many languages: http://en.wikipedia.org/wiki/Active_record_pattern ). It was of course developed by the Yii developers team (mostly by its creator Qiang Xue, I guess). The same concept was improved for Yii 2. Yii guide gives credit to Ruby on Rails AR when talking about Named Scopes: http://www.yiiframework.com/doc/guide/1.1/en/database.ar#named-scopes I am not an expert of Ruby on Rails, but I know relations are defined in a very similar way in the two ORMs: http://www.yiiframework.com/doc/guide/1.1/en/database.arr#declaring-relationship

Active Record in Ruby on Rails: http://guides.rubyonrails.org/

The ActiveRecord class in Ruby on Rails: http://ar.rubyonrails.org/

Active Record in Yii: http://www.yiiframework.com/doc/guide/1.1/en/database.ar

The CActiveRecord class in Yii: http://www.yiiframework.com/doc/api/1.1/CActiveRecord

And last but not least, the Yii developers team in GitHub! https://github.com/yiisoft?tab=members

like image 37
taseenb Avatar answered Oct 05 '22 22:10

taseenb