instances added god may help
This commit is contained in:
55
lib/Service/User/UserDirectoryGateway.php
Normal file
55
lib/Service/User/UserDirectoryGateway.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace MintyPHP\Service\User;
|
||||
|
||||
use MintyPHP\Repository\Access\RoleRepository;
|
||||
use MintyPHP\Repository\Org\DepartmentRepository;
|
||||
use MintyPHP\Repository\Tenant\TenantRepository;
|
||||
|
||||
class UserDirectoryGateway
|
||||
{
|
||||
public function listTenantIds(): array
|
||||
{
|
||||
return (new TenantRepository())->listIds();
|
||||
}
|
||||
|
||||
public function listTenantsByIds(array $tenantIds): array
|
||||
{
|
||||
return (new TenantRepository())->listByIds($tenantIds);
|
||||
}
|
||||
|
||||
public function findTenant(int $tenantId): ?array
|
||||
{
|
||||
return (new TenantRepository())->find($tenantId);
|
||||
}
|
||||
|
||||
public function listActiveTenantIdsByIds(array $tenantIds): array
|
||||
{
|
||||
return (new TenantRepository())->listActiveIdsByIds($tenantIds);
|
||||
}
|
||||
|
||||
public function listActiveRoleIds(): array
|
||||
{
|
||||
return (new RoleRepository())->listActiveIds();
|
||||
}
|
||||
|
||||
public function listRolesByIds(array $roleIds): array
|
||||
{
|
||||
return (new RoleRepository())->listByIds($roleIds);
|
||||
}
|
||||
|
||||
public function listDepartmentsByIds(array $departmentIds, bool $includeInactive = true): array
|
||||
{
|
||||
return (new DepartmentRepository())->listByIds($departmentIds, $includeInactive);
|
||||
}
|
||||
|
||||
public function listActiveDepartmentIdsByTenantIds(array $tenantIds): array
|
||||
{
|
||||
return (new DepartmentRepository())->listActiveIdsByTenantIds($tenantIds);
|
||||
}
|
||||
|
||||
public function listDepartmentsByTenantIds(array $tenantIds): array
|
||||
{
|
||||
return (new DepartmentRepository())->listByTenantIds($tenantIds);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user