Sulu\Component\Webspace\Manager\WebspaceCollection::setPortalInformations PHP Method

setPortalInformations() public method

Sets the portal Information for this collection.
public setPortalInformations ( array $portalInformations )
$portalInformations array
    public function setPortalInformations($portalInformations)
    {
        $this->portalInformations = $portalInformations;
    }

Usage Example

Ejemplo n.º 1
0
 public function build()
 {
     $finder = new Finder();
     $finder->in($this->path)->files()->name('*.xml')->sortByName();
     // Iterate over config files, and add a portal object for each config to the collection
     $collection = new WebspaceCollection();
     // reset arrays
     $this->webspaces = [];
     $this->portals = [];
     $this->portalInformations = [];
     foreach ($finder as $file) {
         // add file resource for cache invalidation
         $collection->addResource(new FileResource($file->getRealPath()));
         /** @var Webspace $webspace */
         $webspace = $this->loader->load($file->getRealPath());
         $this->webspaces[] = $webspace;
         $this->buildPortals($webspace);
     }
     $environments = array_keys($this->portalInformations);
     foreach ($environments as $environment) {
         // sort all portal informations by length
         uksort($this->portalInformations[$environment], function ($a, $b) {
             return strlen($a) < strlen($b);
         });
     }
     $collection->setWebspaces($this->webspaces);
     $collection->setPortals($this->portals);
     $collection->setPortalInformations($this->portalInformations);
     return $collection;
 }
All Usage Examples Of Sulu\Component\Webspace\Manager\WebspaceCollection::setPortalInformations