Cactiverecordinheritance

I just have finished this little extension that adds supports for model inheritance.

It doesn’t need to settle anything apart from the extension indeed.

It works on the fly, catching all the parent model attributes and setting them in the child model.

As I said is an early stage version, and I haven’t tested to much, so I would love to know any kind tips and bugs.

Quick example of what it does:

Car:

  • id

  • name

SportCar:

  • car_id

  • power

FamilyCar:

  • car_id

  • seats


 $sportCar = new SportCar();

 $sportCar->name  = 'FastCar';

 $sportCar->power = 120;

 $sportCar->save();


 $familyCars = FamilyCar::model()->findAllByAttributes(array('seats'=><img src='http://www.yiiframework.com/forum/public/style_emoticons/default/cool.gif' class='bbc_emoticon' alt='8)' />);