private function getPermalinkAttribute(ItemInterface $item)
{
$attributes = $item->getAttributes();
$permalink = isset($attributes['permalink']) ? $attributes['permalink'] : $this->defaultPermalink;
if (is_string($permalink) === false) {
throw new AttributeValueException('Invalid value. Expected string.', 'permalink', $item->getPath());
}
if (trim($permalink) === '') {
throw new AttributeValueException('Invalid value. Expected a non-empty value.', 'permalink', $item->getPath());
}
return $permalink;
}