Created
May 27, 2013 06:06
-
-
Save muya/5655411 to your computer and use it in GitHub Desktop.
Snippet of a Yii model's relations function
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
/** | |
* @return array relational rules. | |
*/ | |
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( | |
'studentProfiles' => array(self::HAS_MANY, 'StudentProfiles', 'userID'), | |
'userGroupMappings' => array(self::HAS_MANY, 'UserGroupMappings', 'userID'), | |
'status_' => array(self::BELONGS_TO, 'EntityStates', 'status') | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment