/** * Initialize method for model. */ public function initialize() { $this->hasMany('id', Note::className(), 'user_id', ['alias' => 'notes']); }