listen ansichten verbessert
This commit is contained in:
@@ -9,72 +9,59 @@ use MintyPHP\Repository\Tenant\TenantRepositoryInterface;
|
||||
class UserDirectoryGateway
|
||||
{
|
||||
public function __construct(
|
||||
private readonly UserRepositoryFactory $userRepositoryFactory
|
||||
private readonly TenantRepositoryInterface $tenantRepository,
|
||||
private readonly RoleRepositoryInterface $roleRepository,
|
||||
private readonly DepartmentRepositoryInterface $departmentRepository,
|
||||
) {
|
||||
}
|
||||
|
||||
public function listTenantIds(): array
|
||||
{
|
||||
return $this->tenantRepository()->listIds();
|
||||
return $this->tenantRepository->listIds();
|
||||
}
|
||||
|
||||
public function listTenantsByIds(array $tenantIds): array
|
||||
{
|
||||
return $this->tenantRepository()->listByIds($tenantIds);
|
||||
return $this->tenantRepository->listByIds($tenantIds);
|
||||
}
|
||||
|
||||
public function findTenant(int $tenantId): ?array
|
||||
{
|
||||
return $this->tenantRepository()->find($tenantId);
|
||||
return $this->tenantRepository->find($tenantId);
|
||||
}
|
||||
|
||||
public function findTenantByUuid(string $tenantUuid): ?array
|
||||
{
|
||||
return $this->tenantRepository()->findByUuid($tenantUuid);
|
||||
return $this->tenantRepository->findByUuid($tenantUuid);
|
||||
}
|
||||
|
||||
public function listActiveTenantIdsByIds(array $tenantIds): array
|
||||
{
|
||||
return $this->tenantRepository()->listActiveIdsByIds($tenantIds);
|
||||
return $this->tenantRepository->listActiveIdsByIds($tenantIds);
|
||||
}
|
||||
|
||||
public function listActiveRoleIds(): array
|
||||
{
|
||||
return $this->roleRepository()->listActiveIds();
|
||||
return $this->roleRepository->listActiveIds();
|
||||
}
|
||||
|
||||
public function listRolesByIds(array $roleIds): array
|
||||
{
|
||||
return $this->roleRepository()->listByIds($roleIds);
|
||||
return $this->roleRepository->listByIds($roleIds);
|
||||
}
|
||||
|
||||
public function listDepartmentsByIds(array $departmentIds, bool $includeInactive = true): array
|
||||
{
|
||||
return $this->departmentRepository()->listByIds($departmentIds, $includeInactive);
|
||||
return $this->departmentRepository->listByIds($departmentIds, $includeInactive);
|
||||
}
|
||||
|
||||
public function listActiveDepartmentIdsByTenantIds(array $tenantIds): array
|
||||
{
|
||||
return $this->departmentRepository()->listActiveIdsByTenantIds($tenantIds);
|
||||
return $this->departmentRepository->listActiveIdsByTenantIds($tenantIds);
|
||||
}
|
||||
|
||||
public function listDepartmentsByTenantIds(array $tenantIds): array
|
||||
{
|
||||
return $this->departmentRepository()->listByTenantIds($tenantIds);
|
||||
}
|
||||
|
||||
private function tenantRepository(): TenantRepositoryInterface
|
||||
{
|
||||
return $this->userRepositoryFactory->createTenantRepository();
|
||||
}
|
||||
|
||||
private function roleRepository(): RoleRepositoryInterface
|
||||
{
|
||||
return $this->userRepositoryFactory->createRoleRepository();
|
||||
}
|
||||
|
||||
private function departmentRepository(): DepartmentRepositoryInterface
|
||||
{
|
||||
return $this->userRepositoryFactory->createDepartmentRepository();
|
||||
return $this->departmentRepository->listByTenantIds($tenantIds);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user