src/Sulu/Component/Webspace/Manager/WebspaceCollection.php
public function toArray()
    {
        $collection = [];

        $webspaces = [];
        foreach ($this->webspaces as $webspace) {
            $webspaces[] = $webspace->toArray();
        }

        $portalInformations = [];
        foreach ($this->portalInformations as $environment => $environmentPortalInformations) {
            $portalInformations[$environment] = [];

            foreach ($environmentPortalInformations as $environmentPortalInformation) {
                $portalInformations[$environment][$environmentPortalInformation->getUrl()] = $environmentPortalInformation->toArray();
            }
        }

        $collection['webspaces'] = $webspaces;
        $collection['portalInformations'] = $portalInformations;

        return $collection;
    }
public function toArray()
    {
        $collection = [];

        $webspaces = [];
        foreach ($this->webspaces as $webspace) {
            $webspaces[] = $webspace->toArray();
        }

        $portalInformations = [];
        foreach ($this->portalInformations as $environment => $environmentPortalInformations) {
            $portalInformations[$environment] = [];

            foreach ($environmentPortalInformations as $environmentPortalInformation) {
                $portalInformations[$environment][$environmentPortalInformation->getUrl()] = $environmentPortalInformation->toArray();
            }
        }

        $collection['webspaces'] = $webspaces;
        $collection['portalInformations'] = $portalInformations;

        return $collection;
    }
public function toArray ( ) { $ collection = [ ] ; $ webspaces = [ ] ; foreach ( $ this -> webspaces as $ webspace ) { $ webspaces [ ] = $ webspace -> toArray ( ) ; } $ portalInformations = [ ] ; foreach ( $ this -> portalInformations as $ environment => $ environmentPortalInformations ) { $ portalInformations [ $ environment ] = [ ] ; foreach ( $ environmentPortalInformations as $ environmentPortalInformation ) { $ portalInformations [ $ environment ] [ $ environmentPortalInformation -> getUrl ( ) ] = $ environmentPortalInformation -> toArray ( ) ; } } $ collection [ 'webspaces' ] = $ webspaces ; $ collection [ 'portalInformations' ] = $ portalInformations ; return $ collection ; }
Returns the content of these portals as array.

@return array
Returns the content of these portals as array .