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