Add a location visitor to the command

@param string                   $location Location to associate with the visitor
@param ResponseVisitorInterface $visitor  Visitor to attach

@return self
551370
public function addVisitor($location, ResponseVisitorInterface $visitor)
    {
        $this->factory->addResponseVisitor($location, $visitor);

        return $this;
    }
425484
protected function addPathLocation($location)
    {
        // First path is in the selected theme.
        $hints[] = public_path($location);

        // This is nice feature to use inherit from another.
        if ($this->getConfig('inherit')) {
            // Inherit from theme name.
            $inherit = $this->getConfig('inherit');

            // Inherit theme path.
            $inheritPath = public_path($this->path($inherit));

            if ($this->files->isDirectory($inheritPath)) {
                array_push($hints, $inheritPath);
            }
        }

        // Add namespace with hinting paths.
        $this->view->addNamespace($this->getThemeNamespace(), $hints);
    }
1074318
public function addVisitor(\BlackForest\PiwikBundle\Entity\PiwikVisitor $visitor)
    {
        $this->visitor[] = $visitor;

        return $this;
    }
820032
public function createLocation(Location $location): UIValue\Content\Location
    {
        return new UIValue\Content\Location($location, [
            'childCount' => $this->locationService->getLocationChildCount($location),
            'pathLocations' => $this->pathService->loadPathLocations($location),
            'userCanManage' => $this->permissionResolver->canUser(
                'content', 'manage_locations', $location->getContentInfo()
            ),
            'userCanRemove' => $this->permissionResolver->canUser(
                'content', 'remove', $location->getContentInfo(), [$location]
            ),
            'userCanEdit' => $this->permissionResolver->canUser(
                'content', 'edit', $location->getContentInfo(), [$location]
            ),
            'main' => $location->getContentInfo()->mainLocationId === $location->id,
        ]);
    }
316513
public function setLocation($location)
    {
        Validate::isString($location, 'location');
        Validate::notNullOrEmpty($location, 'location');

        $this->_location = $location;
    }
697416
public function prependLocation($location)
    {
        if ($location && !in_array($location, $this->paths)) {
            array_unshift($this->paths, $location);
        }

        return $this;
    }
726054
public function setLocation(\BlackForest\PiwikBundle\Entity\PiwikLocation $location = null)
    {
        $this->location = $location;

        return $this;
    }
1345893
public static function redirect($location, $permanent = false)
    {
        $response = new self(
            $permanent ? Status::MOVED_PERMANENTLY : Status::SEE_OTHER,
            new StringStream('')
        );
        $response->setHeader('Location', $location);
        return $response;
    }
111415
public function setSourceLocation(\CampaignChain\CoreBundle\Entity\Location $sourceLocation)
    {
        $this->sourceLocation = $sourceLocation;

        return $this;
    }
1213990
public function setLocation(string $location)
    {
        if (empty($location)) {
            Throw new HeaderException('Empty location is now allowed.');
        }

        $this->location = $location;
    }
1188502
public function accept(VisitorInterface $visitor): void
    {
        $visitor->visitBefore($this);

        foreach ($this->getChildren() as $node) {
            $node->accept($visitor);
        }

        $visitor->visitAfter($this);
    }
1212837
public function doGenerate($location, array $parameters)
    {
        $urlAliasService = $this->repository->getURLAliasService();

        $siteaccess = null;
        if (isset($parameters['siteaccess'])) {
            $siteaccess = $parameters['siteaccess'];
            unset($parameters['siteaccess']);
        }

        if ($siteaccess) {
            // We generate for a different SiteAccess, so potentially in a different language.
            $languages = $this->configResolver->getParameter('languages', null, $siteaccess);
            $urlAliases = $urlAliasService->listLocationAliases($location, false, null, null, $languages);
            // Use the target SiteAccess root location
            $rootLocationId = $this->configResolver->getParameter('content.tree_root.location_id', null, $siteaccess);
        } else {
            $languages = null;
            $urlAliases = $urlAliasService->listLocationAliases($location, false);
            $rootLocationId = $this->rootLocationId;
        }

        $queryString = '';
        unset($parameters['language'], $parameters['contentId']);
        if (!empty($parameters)) {
            $queryString = '?' . http_build_query($parameters, '', '&');
        }

        if (!empty($urlAliases)) {
            $path = $urlAliases[0]->path;
            // Remove rootLocation's prefix if needed.
            if ($rootLocationId !== null) {
                $pathPrefix = $this->getPathPrefixByRootLocationId($rootLocationId, $languages, $siteaccess);
                // "/" cannot be considered as a path prefix since it's root, so we ignore it.
                if ($pathPrefix !== '/' && ($path === $pathPrefix || mb_stripos($path, $pathPrefix . '/') === 0)) {
                    $path = mb_substr($path, mb_strlen($pathPrefix));
                } elseif ($pathPrefix !== '/' && !$this->isUriPrefixExcluded($path) && $this->logger !== null) {
                    // Location path is outside configured content tree and doesn't have an excluded prefix.
                    // This is most likely an error (from content edition or link generation logic).
                    $this->logger->warning("Generating a link to a location outside root content tree: '$path' is outside tree starting to location #$rootLocationId");
                }
            }
        } else {
            $path = $this->defaultRouter->generate(
                self::INTERNAL_CONTENT_VIEW_ROUTE,
                array('contentId' => $location->contentId, 'locationId' => $location->id)
            );
        }

        $path = $path ?: '/';

        // replace potentially unsafe characters with url-encoded counterpart
        return strtr($path . $queryString, $this->unsafeCharMap);
    }
717427
public function setLocation($location): self
    {
        if ($location instanceof LocationResponse) {
            $this->setLocationResponse($location);

            return $this;
        }

        if ($location instanceof StopLocationResponse) {
            $this->setStopResponse($location);

            return $this;
        }

        if (\is_int($location) || \is_string($location)) {
            $this->setLocationId($location);

            return $this;
        }

        throw new \InvalidArgumentException(
            'The location must be either a LocationResponse object, StopLocationResponse object, string or integer'
        );
    }
749035
public function accept(NodeElementVisitorInterface $visitor)
    {
        $visitor->visitNodeFirst($this);
        foreach ($this->elements as $element) {
            $element->accept($visitor);
        }
        $visitor->visitNode($this);
    }
990667
public function viewBreadcrumbAction(Location $location)
    {
        /** @var WhiteOctober\BreadcrumbsBundle\Templating\Helper\BreadcrumbsHelper $breadcrumbs */
        $breadcrumbs = $this->get('white_october_breadcrumbs');

        $locationService = $this->getRepository()->getLocationService();
        $path = $location->path;

        // The root location can be defined at site access level
        $rootLocationId = $this->getConfigResolver()->getParameter('content.tree_root.location_id');

        /** @var eZ\Publish\Core\Helper\TranslationHelper $translationHelper */
        $translationHelper = $this->get('ezpublish.translation_helper');

        $isRootLocation = false;

        // Shift of location "1" from path as it is not a fully valid location and not readable by most users
        array_shift($path);

        for ($i = 0; $i < count($path); ++$i) {
            $location = $locationService->loadLocation($path[$i]);
            // if root location hasn't been found yet
            if (!$isRootLocation) {
                // If we reach the root location We begin to add item to the breadcrumb from it
                if ($location->id == $rootLocationId) {
                    $isRootLocation = true;
                    $breadcrumbs->addItem(
                        $translationHelper->getTranslatedContentNameByContentInfo($location->contentInfo),
                        $this->generateUrl($location)
                    );
                }
            }
            // The root location has already been reached, so we can add items to the breadcrumb
            else {
                $breadcrumbs->addItem(
                    $translationHelper->getTranslatedContentNameByContentInfo($location->contentInfo),
                    $this->generateUrl($location)
                );
            }
        }

        // We don't want the breadcrumb to be displayed if we are on the frontpage
        // which means we display it only if we have several items in it
        if (count($breadcrumbs) <= 1) {
            return new Response();
        }

        return $this->render(
            'eZDemoBundle::breadcrumb.html.twig'
        );
    }
661580
public function addChild(Location $location): void
    {
        if ($this->hasChild($location)) {
            throw new InvalidArgumentException(
                'The same Location cannot be added twice');
        }

        $location->setWarehouse(null);
        $location->setParent($this);

        $this->addTreeChild($location);
    }
171212
public function addVisitor(Twig_NodeVisitorInterface $visitor)
    {
        if (!isset($this->visitors[$visitor->getPriority()])) {
            $this->visitors[$visitor->getPriority()] = array();
        }

        $this->visitors[$visitor->getPriority()][] = $visitor;
    }