dump() public method

Creates a new class with the data from the given collection.
public dump ( array $options = [] ) : string
$options array
return string
Example #1
0
 /**
  * Returns all the webspaces managed by this specific instance.
  *
  * @return WebspaceCollection
  */
 public function getWebspaceCollection()
 {
     if ($this->webspaceCollection === null) {
         $class = $this->options['cache_class'];
         $cache = new ConfigCache($this->options['cache_dir'] . '/' . $class . '.php', $this->options['debug']);
         if (!$cache->isFresh()) {
             $webspaceCollectionBuilder = new WebspaceCollectionBuilder($this->loader, $this->urlReplacer, $this->options['config_dir']);
             $webspaceCollection = $webspaceCollectionBuilder->build();
             $dumper = new PhpWebspaceCollectionDumper($webspaceCollection);
             $cache->write($dumper->dump(['cache_class' => $class, 'base_class' => $this->options['base_class']]), $webspaceCollection->getResources());
         }
         require_once $cache->getPath();
         $this->webspaceCollection = new $class();
     }
     return $this->webspaceCollection;
 }