added get sub categories

This commit is contained in:
vedatakd 2021-04-16 08:49:45 +03:00
parent 166e594e71
commit 1af16e10a0
2 changed files with 7 additions and 0 deletions

View File

@ -64,4 +64,9 @@ class CategoryModel extends CatsCategoryEntryModel implements CategoryInterface
{
$this->update(['icon' => $url]);
}
public function getSubCategories()
{
return $this->where('parent_category_id', $this->getId())->get();
}
}

View File

@ -13,4 +13,6 @@ interface CategoryInterface extends EntryInterface
public function getMains($id);
public function setCategoryIconUrl($url);
public function getSubCategories();
}