eZ\Bundle\EzPublishMigrationBundle\Command\LegacyStorage\RegenerateUrlAliasesCommand::publishAliases PHP Method

publishAliases() protected method

Publishes URL aliases in all languages for the given parameters.
protected publishAliases ( integer | string $locationId, integer | string $parentLocationId, integer | string $contentId ) : integer
$locationId integer | string
$parentLocationId integer | string
$contentId integer | string
return integer
    protected function publishAliases($locationId, $parentLocationId, $contentId)
    {
        $content = $this->contentService->loadContent($contentId);
        $urlAliasNames = $this->nameSchemaResolver->resolveUrlAliasSchema($content);
        foreach ($urlAliasNames as $languageCode => $name) {
            try {
                $this->setMigrationTable();
                $this->urlAliasHandler->publishUrlAliasForLocation($locationId, $parentLocationId, $name, $languageCode, $content->contentInfo->alwaysAvailable);
                $this->setDefaultTable();
            } catch (Exception $e) {
                $this->setDefaultTable();
                throw $e;
            }
        }
        return count($urlAliasNames);
    }