public function exportWebsite(Workspace $workspace, &$files, Website $object) { //Getting all website pages and building array $rootWebsitePage = $object->getRoot(); $websitePages = $this->websitePageRepository->children($rootWebsitePage); array_unshift($websitePages, $rootWebsitePage); $websitePagesArray = array(); foreach ($websitePages as $websitePage) { $websitePagesArray[] = $websitePage->exportToArray($this->router, $files); } $websiteOptionsArray = $object->getOptions()->exportToArray($this->webDir, $files); $data = array('options' => $websiteOptionsArray, 'pages' => $websitePagesArray); return $data; }