コード例 #1
0
ファイル: Category.php プロジェクト: zabachok/yii2-burivuh
 public function getChildrenCategory()
 {
     return $this->hasMany(Category::className(), ['parent_id' => 'category_id']);
 }
コード例 #2
0
ファイル: Document.php プロジェクト: zabachok/yii2-burivuh
 public function getCategory()
 {
     return $this->hasOne(Category::className(), ['category_id' => 'category_id']);
 }