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;
}
/** * Creates a new class with the data from the given collection. * * @param array $options * * @return string */ public function dump($options = []) { return $this->render('WebspaceCollectionClass.php.twig', ['cache_class' => $options['cache_class'], 'base_class' => $options['base_class'], 'collection' => $this->webspaceCollection->toArray()]); }