ActiveRecord Inheritance

I have an Active Record called User

class User extends CActiveRecord


have a Register class which extends User

when i call

$model = Register::model()->findByPk(1);

echo get_class($model); // returns User

when i call

$model = CActiveRecord::model(‘Register’)->findByPk(1);

echo get_class($model); // returns Register

Is this a bug? or is that the expected result?

Make sure you have the following method in the Register class:

public static function model($className=__CLASS__)


    return parent::model($className);