Beispiel #1
0
 /**
  * returns actions that was made by this user on some videos
  * @return ActiveQuery
  */
 public function getVideoActions()
 {
     return $this->hasMany(VideoAction::className(), ['user_id' => 'id'])->where(['status' => 'active']);
 }
Beispiel #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getVideoAction()
 {
     return $this->hasOne(VideoAction::className(), ['video_id' => 'id'])->where(['user_id' => Yii::$app->user->id])->all();
 }