diff --git a/src/Document/Schema/Site.php b/src/Document/Schema/Site.php index 3866d624..fead9cd1 100644 --- a/src/Document/Schema/Site.php +++ b/src/Document/Schema/Site.php @@ -36,14 +36,14 @@ final class Site implements AdditionalAttributesInterface public function __construct( #[Property(description: 'ID', type: 'integer', example: 0)] private readonly int $id, - #[Property(description: 'ID of the root', type: 'integer', example: 1)] - private readonly ?int $rootId = null, - #[Property(description: 'Root path', type: 'string', example: '/')] - private readonly ?string $rootPath = null, #[Property(description: 'Domains', type: 'array', items: new Items(type: 'string'), example: ['other_domain'])] private readonly array $domains, #[Property(description: 'Domain', type: 'string', example: 'main_site')] private readonly string $domain, + #[Property(description: 'ID of the root', type: 'integer', example: 1)] + private readonly ?int $rootId = null, + #[Property(description: 'Root path', type: 'string', example: '/')] + private readonly ?string $rootPath = null, ) { } diff --git a/src/Document/Service/SiteService.php b/src/Document/Service/SiteService.php index a61de939..d740f276 100644 --- a/src/Document/Service/SiteService.php +++ b/src/Document/Service/SiteService.php @@ -50,10 +50,10 @@ public function getAvailableSites(ExcludeMainSiteParameter $parameter): array foreach ($siteList as $siteEntry) { $site = new Site( $siteEntry->getId(), + $siteEntry->getDomains(), + $siteEntry->getMainDomain(), $siteEntry->getRootId(), $siteEntry->getRootPath(), - $siteEntry->getDomains(), - $siteEntry->getMainDomain() ); $this->eventDispatcher->dispatch(new SiteEvent($site), SiteEvent::EVENT_NAME); @@ -65,6 +65,6 @@ public function getAvailableSites(ExcludeMainSiteParameter $parameter): array private function getMainSite(): Site { - return new Site(0, 1, '/', [], 'main_site'); + return new Site(0, [], 'main_site', 1, '/'); } }