コード例 #1
0
ファイル: Thread.php プロジェクト: Avenger1/yii2-podium
 /**
  * ThreadView relation.
  * @return ThreadView
  */
 public function getView()
 {
     return $this->hasOne(ThreadView::className(), ['thread_id' => 'id'])->where(['user_id' => User::loggedId()]);
 }
コード例 #2
0
ファイル: Thread.php プロジェクト: pezisc/yii2-podium
 /**
  * ThreadView relation general.
  * @return ThreadView[]
  */
 public function getThreadView()
 {
     return $this->hasMany(ThreadView::className(), ['thread_id' => 'id']);
 }
コード例 #3
0
ファイル: Thread.php プロジェクト: keltstr/yii2-podium
 public function getView()
 {
     return $this->hasOne(ThreadView::className(), ['thread_id' => 'id'])->where(['user_id' => Yii::$app->user->id]);
 }