Yosymfony\Spress\Core\ContentManager\Permalink\PermalinkGenerator::getPermalinkAttribute PHP Method

getPermalinkAttribute() private method

private getPermalinkAttribute ( Yosymfony\Spress\Core\DataSource\ItemInterface $item )
$item Yosymfony\Spress\Core\DataSource\ItemInterface
    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;
    }