CodeExplorer createNewCategories example
'parent' =>
['id' =>
$parentId],
'name' =>
$categoryName,
];
} if ($categoryId !== null
) { $result[] =
['id' =>
$categoryId];
} } if (!
empty($newCategoriesPayload)) { $this->
createNewCategories($newCategoriesPayload);
} $record =
$event->
getRecord();
$record['categories'
] = !
empty($record['categories'
]) ?
array_merge($record['categories'
],
$result) :
$result;
$event->
setRecord($record);
} public function reset(): void
{ $this->categoryIdCache =
[];
}