48 lines
1.1 KiB
PHP
48 lines
1.1 KiB
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace App\Dto\Service\Site;
|
|
|
|
use App\Models\DocumentationVersion;
|
|
use App\Models\Project;
|
|
use App\Models\User;
|
|
use App\Services\WebsiteTranslations;
|
|
|
|
final readonly class Documentation
|
|
{
|
|
public function __construct(
|
|
private Project $project,
|
|
private DocumentationVersion $version,
|
|
private WebsiteTranslations $websiteTranslations,
|
|
private ?User $user = null,
|
|
) { }
|
|
|
|
public function getProject(): Project
|
|
{
|
|
return $this->project;
|
|
}
|
|
|
|
public function getVersion(): DocumentationVersion
|
|
{
|
|
return $this->version;
|
|
}
|
|
|
|
public function getWebsiteTranslations(): WebsiteTranslations
|
|
{
|
|
return $this->websiteTranslations;
|
|
}
|
|
|
|
public function getUser(): ?User
|
|
{
|
|
return $this->user;
|
|
}
|
|
|
|
public function toArray(): array
|
|
{
|
|
return [
|
|
'project' => $this->getProject(),
|
|
'version' => $this->getVersion(),
|
|
'websiteTranslations' => $this->getWebsiteTranslations(),
|
|
];
|
|
}
|
|
}
|