コード例 #1
0
ファイル: Category.php プロジェクト: pendalf89/yii2-blog
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPosts()
 {
     return $this->hasMany(Post::className(), ['category_id' => 'id']);
 }