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