eZ\Publish\Core\Search\Elasticsearch\Content\Indexer::indexLocations PHP Method

indexLocations() private method

Index Locations of the given Content Object.
private indexLocations ( integer $contentId, ProgressBar $progress )
$contentId integer Content Object Id
$progress Symfony\Component\Console\Helper\ProgressBar
    private function indexLocations($contentId, ProgressBar $progress)
    {
        $locationIds = $this->getContentLocationIds($contentId);
        foreach ($locationIds as $locationId) {
            try {
                $location = $this->persistenceHandler->locationHandler()->load($locationId);
                $this->searchHandler->indexLocation($location);
            } catch (NotFoundException $e) {
                $this->logWarning($progress, "Could not load Location with id {$locationId}, so skipped for indexing. Full exception: " . $e->getMessage());
            }
        }
    }