private function getCategoriesPath(ItemInterface $item)
{
$attributes = $item->getAttributes();
if (isset($attributes['categories']) === false) {
return;
}
if (is_array($attributes['categories']) === false) {
throw new AttributeValueException('Invalid value. Expected array.', 'categories', $item->getPath());
}
return implode('/', array_map(function ($a) {
return (new StringWrapper($a))->slug();
}, $attributes['categories']));
}