findPortalInformationsByPortalKeyAndLocale() public method

Returns all portal which matches the given portal-key and locale.
public findPortalInformationsByPortalKeyAndLocale ( string $portalKey, string $locale, string $environment ) : PortalInformation[]
$portalKey string The portal-key which the portal should match
$locale string The locale which the portal should match
$environment string The environment in which the url should be searched
return Sulu\Component\Webspace\PortalInformation[]
コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function process(Request $request, RequestAttributes $requestAttributes)
 {
     if (!$request->get('_locale') && !$request->get('_portal')) {
         return new RequestAttributes();
     }
     $portalInformations = $this->webspaceManager->findPortalInformationsByPortalKeyAndLocale($request->get('_portal'), $request->get('_locale'), $this->environment);
     if (!$portalInformations) {
         return new RequestAttributes();
     }
     return new RequestAttributes(['portalInformation' => reset($portalInformations)]);
 }