Files
breadcrumb-the-shire/lib/Service/Import/Profile/UserImportGateway.php

55 lines
1.5 KiB
PHP
Raw Normal View History

2026-02-23 12:58:19 +01:00
<?php
namespace MintyPHP\Service\Import\Profile;
2026-03-05 08:26:51 +01:00
use MintyPHP\Repository\Access\RoleRepositoryInterface;
use MintyPHP\Repository\Org\DepartmentRepositoryInterface;
use MintyPHP\Repository\Tenant\TenantRepositoryInterface;
use MintyPHP\Repository\User\UserReadRepositoryInterface;
2026-02-23 12:58:19 +01:00
class UserImportGateway
{
public function __construct(
2026-03-05 08:26:51 +01:00
private readonly UserReadRepositoryInterface $userReadRepository,
2026-03-05 11:17:42 +01:00
private readonly TenantRepositoryInterface $tenantRepository,
private readonly RoleRepositoryInterface $roleRepository,
private readonly DepartmentRepositoryInterface $departmentRepository,
2026-02-23 12:58:19 +01:00
) {
}
public function findUserByEmail(string $email): ?array
{
return $this->userReadRepository->findByEmail($email);
}
public function findTenantByUuid(string $uuid): ?array
{
2026-03-05 11:17:42 +01:00
return $this->tenantRepository->findByUuid($uuid);
2026-02-23 12:58:19 +01:00
}
public function findTenantById(int $id): ?array
{
2026-03-05 11:17:42 +01:00
return $this->tenantRepository->find($id);
2026-02-23 12:58:19 +01:00
}
public function findRoleByUuid(string $uuid): ?array
{
2026-03-05 11:17:42 +01:00
return $this->roleRepository->findByUuid($uuid);
2026-02-23 12:58:19 +01:00
}
public function findRoleById(int $id): ?array
{
2026-03-05 11:17:42 +01:00
return $this->roleRepository->find($id);
2026-02-23 12:58:19 +01:00
}
public function findDepartmentByUuid(string $uuid): ?array
{
2026-03-05 11:17:42 +01:00
return $this->departmentRepository->findByUuid($uuid);
2026-02-23 12:58:19 +01:00
}
public function findDepartmentById(int $id): ?array
{
2026-03-05 11:17:42 +01:00
return $this->departmentRepository->find($id);
2026-02-23 12:58:19 +01:00
}
}