I am creating the API for in Yii Framework.
I have users table in DB_1, userBooks table in DB_2. I my page I am overriding the relations. Please see the bellow code.
public function relations()
{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
'userBooks' => array(self::HAS_MANY, 'userbooks', 'userid'),
);
Please check the code and please give me replay. I’ll help me lot.