Returns form handler to use at $location

@param \eZ\Publish\API\Repository\Values\Content\Location $location
@return \Heliopsis\eZFormsBundle\FormHandler\FormHandlerInterface
506084
public function getHandler( Location $location )
    {
        if ( isset( $this->map[$location->contentInfo->remoteId] ) )
        {
            return $this->map[$location->contentInfo->remoteId];
        }

        return new NullHandler();
    }
1359129
public function createRedirect(string $location, int $status = 307): ResponseInterface
    {
        return $this->responseFactory->createResponse($status)->withHeader('Location', $location);
    }
559567
public function editAction(Request $request, Located $located)
    {
        
        $deleteForm = $this->createDeleteForm($located);
        $editForm = $this->createForm('EcommerceBundle\Form\LocatedType', $located, array(
            'action' => $this->generateUrl('ecommerce_located_edit', array('id' => $located->getId())),
            'method' => 'POST',
        ));
        $editForm->handleRequest($request);

        if ($editForm->isSubmitted() && $editForm->isValid()) {
            $em = $this->getDoctrine()->getManager();
            
            $em->persist($located);
            $em->flush();
            
            $this->get('session')->getFlashBag()->add('success', 'located.edited');
            
            return $this->redirectToRoute('ecommerce_located_show', array('id' => $located->getId()));
        }

        return array(
            'entity' => $located,
            'edit_form' => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        );
    }
941449
public function viewParentExtraInfoAction(Location $location)
    {
        $repository = $this->getRepository();
        $parentLocation = $repository->getLocationService()->loadLocation($location->parentLocationId);

        // TODO once the keyword service is available replace part this subrequest by a full symfony one

        return $this->render(
            'eZDemoBundle:parts/blog:extra_info.html.twig',
            array('location' => $parentLocation)
        );
    }
714865
public function createFormForLocation(Location $location, $useAjax = false)
    {
        $contentInfo = $location->contentInfo;

        $contentType = $this->contentTypeService->loadContentType($contentInfo->contentTypeId);

        $data = new DataWrapper(new InformationCollectionStruct(), $contentType, $location);

        $formBuilder = $this->formFactory
            ->createBuilder(
                Kernel::VERSION_ID < 20800 ?
                    'ezforms_information_collection' :
                    InformationCollectionType::class,
                $data,
                array(
                    'csrf_protection' => $this->useCsrf,
                )
            );

        if ($useAjax) {
            $formBuilder->setAction($this->router->generate('netgen_information_collection_handle_ajax', array('location' => $location->id)));
        }

        return $formBuilder;
    }
279746
public function listPlaceListAction(Location $location)
    {
        /** @var \EzSystems\DemoBundle\Helper\PlaceHelper $placeHelper */
        $placeHelper = $this->get('ezdemo.place_helper');

        $places = $placeHelper->getPlaceList(
            $location,
            $this->container->getParameter('ezdemo.places.place_list.content_types'),
            $this->getConfigResolver()->getParameter('languages')
        );

        return $this->render(
            'eZDemoBundle:parts/place:place_list.html.twig',
            array('places' => $places)
        );
    }
1341176
protected function getExtension(Location $location): ExtensionInterface
    {
        foreach ($this->extensions as $extension) {
            if ($extension->matches($location)) {
                return $extension;
            }
        }

        return $this->fallbackExtension;
    }
961762
public static function build($location, $required, $description)
    {
        $param = new static();
        $param->location = $location;
        $param->required = $required;
        $param->description = $description;

        return $param;
    }
570935
private function loadLocation($locationId): Location
    {
        $location = $this->repository->sudo(
            function (Repository $repository) use ($locationId) {
                return $repository->getLocationService()->loadLocation($locationId);
            }
        );

        return $location;
    }
1277675
protected function searchLocation($location)
	{
		$request = file_get_contents(
			sprintf(
				'https://maps.googleapis.com/maps/api/geocode/json?address=%s&sensor=false&key=%s',
				urlencode($location),
				$this->getKey()
			)
		);

		return json_decode($request);
	}
857951
public function update(UpdateStruct $location, $locationId)
    {
        try {
            return $this->innerGateway->update($location, $locationId);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
616241
public static function createRedirectResponse(string $location): ResponseInterface
    {
        if (empty($location)) {

            throw new InvalidArgumentException("Location header value cannot be empty");

        }

        $response = new Response(302);
        return $response->withHeader("Location", $location);
    }
915435
public function transform(LocationInterface $location)
    {
        return $this
            ->locationDataFactory
            ->create(
                $location->getId(),
                $location->getName(),
                $location->getCode(),
                $location->getType()
            );
    }
154375
public function tagHttpCacheForLocation(Location $location)
    {
        $this->responseTagger->tag($location);
        $this->responseTagger->tag($location->getContentInfo());
    }
640320
public function matchLocation(APILocation $location)
    {
        $parentContentType = $this->repository->sudo(
            function (Repository $repository) use ($location) {
                $parent = $repository->getLocationService()->loadLocation($location->parentLocationId);

                return $repository
                    ->getContentTypeService()
                    ->loadContentType($parent->getContentInfo()->contentTypeId);
            }
        );

        return isset($this->values[$parentContentType->identifier]);
    }
832383
protected function checkCategoryRedirect(Location $location): ?RedirectResponse
    {
        $content = $location->content;

        $internalRedirectContent = null;
        if (!$content->getField('internal_redirect')->isEmpty()) {
            $internalRedirectContent = $content->getFieldRelation('internal_redirect');
        }

        $externalRedirectValue = $content->getField('external_redirect')->value;

        if ($internalRedirectContent instanceof Content) {
            if ($internalRedirectContent->contentInfo->mainLocationId !== $location->id) {
                return new RedirectResponse(
                    $this->router->generate($internalRedirectContent),
                    RedirectResponse::HTTP_MOVED_PERMANENTLY
                );
            }
        } elseif ($externalRedirectValue instanceof UrlValue && !$content->getField('external_redirect')->isEmpty()) {
            if (mb_stripos($externalRedirectValue->link, 'http') === 0) {
                return new RedirectResponse($externalRedirectValue->link, RedirectResponse::HTTP_MOVED_PERMANENTLY);
            }

            return new RedirectResponse(
                $this->router->generate($this->getRootLocation()) . trim($externalRedirectValue->link, '/'),
                RedirectResponse::HTTP_MOVED_PERMANENTLY
            );
        }

        return null;
    }
963961
public function load(Location $location): self
    {
        $customUrlAliases = $this->urlAliasService->listLocationAliases($location, true, null, true);
        $this->data = array_map(
            function (URLAlias $urlAlias) {
                return $this->valueFactory->createUrlAlias($urlAlias);
            },
            $customUrlAliases
        );

        return $this;
    }