コード例 #1
0
ファイル: User.php プロジェクト: shutkos/notejam
 /**
  * Get notes
  */
 public function getNotes()
 {
     return $this->hasMany(Note::className(), ['user_id' => 'id']);
 }
コード例 #2
0
ファイル: Access.php プロジェクト: Cannabiscat/yii2-cource
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getNote()
 {
     return $this->hasOne(Note::className(), ['id' => 'note_id']);
 }
コード例 #3
0
ファイル: Video.php プロジェクト: abutouq/video
 /**
  * @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();
 }