/** * Get notes */ public function getNotes() { return $this->hasMany(Note::className(), ['user_id' => 'id']); }
/** * @return \yii\db\ActiveQuery */ public function getNote() { return $this->hasOne(Note::className(), ['id' => 'note_id']); }
/** * @return \yii\db\ActiveQuery * @internal param int $user_id */ public function getVideoNotes() { return $this->hasMany(Note::className(), ['video_id' => 'id'])->where(['user_id' => Yii::$app->user->id])->andFilterWhere(['status' => 'new'])->all(); }