示例#1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getArticles()
 {
     return $this->hasMany(Article::className(), ['author_id' => 'id']);
 }
示例#2
0
 public function getArticlesCount()
 {
     return $this->hasMany(Article::className(), ['category_id' => 'id'])->count();
 }