Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Snippet of a Yii model's relations function
/**
* @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
You can’t perform that action at this time.