Files
breadcrumb-the-shire/core/Service/User/UserSettingsGateway.php

61 lines
1.6 KiB
PHP
Raw Normal View History

2026-02-23 12:58:19 +01:00
<?php
namespace MintyPHP\Service\User;
2026-03-06 00:44:52 +01:00
use MintyPHP\Service\Settings\SettingsAppGateway;
use MintyPHP\Service\Settings\SettingsDefaultsGateway;
use MintyPHP\Service\Settings\SettingsUserLifecycleGateway;
2026-02-23 12:58:19 +01:00
class UserSettingsGateway
{
2026-03-06 00:44:52 +01:00
public function __construct(
private readonly SettingsDefaultsGateway $settingsDefaultsGateway,
private readonly SettingsAppGateway $settingsAppGateway,
private readonly SettingsUserLifecycleGateway $settingsUserLifecycleGateway
) {
2026-02-23 12:58:19 +01:00
}
public function getDefaultTenantId(): ?int
{
2026-03-06 00:44:52 +01:00
return $this->settingsDefaultsGateway->getDefaultTenantId();
2026-02-23 12:58:19 +01:00
}
public function getDefaultRoleId(): ?int
{
2026-03-06 00:44:52 +01:00
return $this->settingsDefaultsGateway->getDefaultRoleId();
2026-02-23 12:58:19 +01:00
}
public function getDefaultDepartmentId(): ?int
{
2026-03-06 00:44:52 +01:00
return $this->settingsDefaultsGateway->getDefaultDepartmentId();
2026-02-23 12:58:19 +01:00
}
/**
* @return array<string, string>
*/
public function appThemes(): array
{
return $this->settingsAppGateway->listThemes();
}
public function defaultTheme(): string
{
return $this->settingsAppGateway->resolveDefaultTheme();
}
public function normalizeTheme(?string $theme): string
{
return $this->settingsAppGateway->normalizeTheme($theme);
}
2026-02-23 12:58:19 +01:00
public function getUserInactivityDeactivateDays(): int
{
2026-03-06 00:44:52 +01:00
return $this->settingsUserLifecycleGateway->getUserInactivityDeactivateDays();
2026-02-23 12:58:19 +01:00
}
public function getUserInactivityDeleteDays(): int
{
2026-03-06 00:44:52 +01:00
return $this->settingsUserLifecycleGateway->getUserInactivityDeleteDays();
2026-02-23 12:58:19 +01:00
}
}