Sulu\Component\Webspace\Manager\WebspaceManagerInterface::findPortalByKey PHP Method

findPortalByKey() public method

Returns the portal with the given key.
public findPortalByKey ( string $key ) : Portal
$key string The key to search for
return Sulu\Component\Webspace\Portal
    public function findPortalByKey($key);

Usage Example

Esempio n. 1
0
 /**
  * Returns array of locales for given portal key.
  *
  * @param string $portalKey
  *
  * @return string[]
  */
 private function getLocalesByPortalKey($portalKey)
 {
     $portal = $this->webspaceManager->findPortalByKey($portalKey);
     return array_map(function (Localization $localization) {
         return $localization->getLocalization();
     }, $portal->getLocalizations());
 }