Example #1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getArticles()
 {
     return $this->hasMany(Article::className(), ['category_id' => 'id']);
 }
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getArticle()
 {
     return $this->hasOne(Article::className(), ['id' => 'article_id']);
 }