mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-10 15:26:10 -06:00
#162 Creating Multiple cats once
This commit is contained in:
parent
78aa96b714
commit
f5809246ac
@ -108,6 +108,15 @@ class CategoryController extends AdminController
|
|||||||
array_push($isMultiCat, $firstArray);
|
array_push($isMultiCat, $firstArray);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (empty($isMultiCat)) {
|
||||||
|
$this->categoryRepository->create(array_merge($translatableEntries, [
|
||||||
|
'slug' => $all['slug'],
|
||||||
|
'parent_category' => $all['parent_category'],
|
||||||
|
'icon' => $all['icon'],
|
||||||
|
'seo_keyword' => $all['seo_keyword'],
|
||||||
|
'seo_description' => $all['seo_description'],
|
||||||
|
]));
|
||||||
|
} else {
|
||||||
for ($i = 0; $i < count($isMultiCat[0]); $i++) {
|
for ($i = 0; $i < count($isMultiCat[0]); $i++) {
|
||||||
foreach ($isMultiCat as $cat) {
|
foreach ($isMultiCat as $cat) {
|
||||||
$translatableEntries = array_merge($translatableEntries, $cat[$i]);
|
$translatableEntries = array_merge($translatableEntries, $cat[$i]);
|
||||||
@ -120,6 +129,7 @@ class CategoryController extends AdminController
|
|||||||
'seo_description' => $all['seo_description'],
|
'seo_description' => $all['seo_description'],
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// $this->categoryRepository->create(array_merge($translatableEntries, [
|
// $this->categoryRepository->create(array_merge($translatableEntries, [
|
||||||
// 'slug' => $all['slug'],
|
// 'slug' => $all['slug'],
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user