/**
  * @return \yii\db\ActiveQuery
  */
 public function getBlogs()
 {
     return $this->hasMany(Blog::className(), ['category_id' => 'id']);
 }
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getBlog()
 {
     return $this->hasOne(Blog::className(), ['id' => 'blog_id']);
 }
Exemple #3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getBlogs()
 {
     return $this->hasMany(Blog::className(), ['id' => 'blog_id'])->viaTable('tbl_blog_tag', ['tag_id' => 'id']);
 }