Created
October 11, 2013 09:50
-
-
Save indrekots/6932280 to your computer and use it in GitHub Desktop.
Defining a "belongs to" relation with Yii's namespaced Active Record
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
... | |
public function relations() { | |
return array( | |
'ParentModel' => array(self::BELONGS_TO, 'application\models\ParentModel', 'parent_model_id') | |
); | |
} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment