Merge pull request #759 from openclassify/dia

#2505 Advanced Package ad limit is required
This commit is contained in:
Fatih Alp 2020-10-29 12:23:50 +03:00 committed by GitHub
commit 41c500fbdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,7 +15,7 @@ class CategoryModel extends CatsCategoryEntryModel implements CategoryInterface
->first();
}
public function getParentCats($id, $type = null)
public function getParentCats($id, $type = null, $noMainCat = true)
{
$cat = $this->getCat($id);
$catNames = array();
@ -30,7 +30,9 @@ class CategoryModel extends CatsCategoryEntryModel implements CategoryInterface
if ($parCat->parent_category_id == "") {
if ($type == "add_main")
$catNames[] = $parCat->name;
break;
if ($noMainCat) {
break;
}
}
$catNames[] = $parCat->name;
$cat_ids[] = $parCat->id;