Hi guys,
In my user table, I have implemented the following relation:
/**
* @return \yii\db\ActiveQuery
*/
public function getUserHasNotificationEvents() {
return $this->hasMany(\app\models\UserHasNotificationEvent::className(),
['tbl_user_id' => 'id']));
}
The UserHasNotificationEvent table has also a related table called UserHasNotificationEventType
Now, I need a orderby like this (in turn of the following related table):
**
* @return \yii\db\ActiveQuery
*/
public function getUserHasNotificationEvents() {
return $this->hasMany(\app\models\UserHasNotificationEvent::className(),
['tbl_user_id' => 'id'])
->orderBy(['tblUserHasNotificationEventType.name' => SORT_ASC]);
}
Does anyone have an idea how to do this?
Thanks a lot!
Toby