$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 =
[];
} /**
* @param list<array<string, mixed>> $payload
*/
private function createNewCategories(array
$payload): void
{