Ejemplo n.º 1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getViewedPosts()
 {
     return $this->hasMany(Post::className(), ['id' => 'post_id'])->viaTable(PostViewed::tableName(), ['user_id' => 'id']);
 }