/** * @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']); }
/** * @return \yii\db\ActiveQuery */ public function getBlogs() { return $this->hasMany(Blog::className(), ['id' => 'blog_id'])->viaTable('tbl_blog_tag', ['tag_id' => 'id']); }