wip first not first or fail attributes form
This commit is contained in:
@@ -113,8 +113,11 @@ class ProductCategoryAttributesTable extends Table
|
||||
|
||||
public function getAllCategoryAttributesForCategoryId(string $internalCategoryId)
|
||||
{
|
||||
$category = $this->ProductCategories->find()->where(['internal_id' => $internalCategoryId])->firstOrFail();
|
||||
$categories = $this->ProductCategories->find('path', for: $category->id)->all();
|
||||
$category = $this->ProductCategories->find()->where(['internal_id' => $internalCategoryId])->first();
|
||||
$categories = [];
|
||||
if ($category) {
|
||||
$categories = $this->ProductCategories->find('path', for: $category->id)->all();
|
||||
}
|
||||
|
||||
return $categories;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user