/**
  * @test
  */
 public function theSiteResourcesPackageKeyCanBeSetAndRetrieved()
 {
     $site = new Site('');
     $site->setSiteResourcesPackageKey('Foo');
     $this->assertSame('Foo', $site->getSiteResourcesPackageKey());
 }
 /**
  * A edit view for a site and its settings.
  *
  * @param Site $site Site to view
  * @Flow\IgnoreValidation("$site")
  * @return void
  */
 public function editAction(Site $site)
 {
     try {
         $sitePackage = $this->packageManager->getPackage($site->getSiteResourcesPackageKey());
     } catch (\Exception $e) {
         $this->addFlashMessage('The site package with key "%s" was not found.', 'Site package not found', Message::SEVERITY_ERROR, array(htmlspecialchars($site->getSiteResourcesPackageKey())));
     }
     $this->view->assignMultiple(array('site' => $site, 'sitePackageMetaData' => isset($sitePackage) ? $sitePackage->getPackageMetaData() : array(), 'domains' => $this->domainRepository->findBySite($site), 'assetCollections' => $this->assetCollectionRepository->findAll()));
 }
 /**
  * Export the given $site to the XMLWriter
  *
  * @param Site $site
  * @param string $nodeTypeFilter
  * @return void
  */
 protected function exportSite(Site $site, $nodeTypeFilter)
 {
     /** @var ContentContext $contentContext */
     $contentContext = $this->contextFactory->create(array('currentSite' => $site, 'invisibleContentShown' => true, 'inaccessibleContentShown' => true));
     $siteNode = $contentContext->getCurrentSiteNode();
     $this->xmlWriter->startElement('site');
     $this->xmlWriter->writeAttribute('name', $site->getName());
     $this->xmlWriter->writeAttribute('state', $site->getState());
     $this->xmlWriter->writeAttribute('siteResourcesPackageKey', $site->getSiteResourcesPackageKey());
     $this->xmlWriter->writeAttribute('siteNodeName', $siteNode->getName());
     $this->nodeExportService->export($siteNode->getPath(), $contentContext->getWorkspaceName(), $this->xmlWriter, false, false, $this->resourcesPath, $nodeTypeFilter);
     $this->xmlWriter->endElement();
 }