Sulu\Component\Webspace\Portal::getLocalizations PHP Method

getLocalizations() public method

Returns the languages of this portal.
public getLocalizations ( ) : Localization[]
return Sulu\Component\Localization\Localization[] The languages of this portal
    public function getLocalizations()
    {
        return $this->localizations;
    }

Usage Example

 /**
  * Returns custom-url data with the connected locales.
  *
  * @param Portal $portal
  * @param Environment $environment
  * @param Context $context
  *
  * @return array
  */
 private function getCustomUrlsForEnvironment(Portal $portal, Environment $environment, Context $context)
 {
     $customUrls = [];
     foreach ($environment->getCustomUrls() as $customUrl) {
         $customUrl = $context->accept($customUrl);
         $customUrl['locales'] = $context->accept($portal->getLocalizations());
         $customUrls[] = $customUrl;
     }
     return $customUrls;
 }