/** * @return \yii\db\ActiveQuery */ public function getParent() { return $this->hasOne(News::className(), ['id' => 'parent_id']); }
/** * @return \yii\db\ActiveQuery */ public function getNews() { return $this->hasMany(News::className(), ['id' => 'news_id'])->viaTable('{{%news_news_tags}}', ['tag_id' => 'id']); }