1
0
Files
breadcrumb-the-shire/lib/Service/Import/Profile/DepartmentImportGateway.php

36 lines
996 B
PHP

<?php
namespace MintyPHP\Service\Import\Profile;
use MintyPHP\Repository\Org\DepartmentRepositoryInterface;
use MintyPHP\Repository\Tenant\TenantRepositoryInterface;
class DepartmentImportGateway
{
public function __construct(
private readonly DepartmentRepositoryInterface $departmentRepository,
private readonly TenantRepositoryInterface $tenantRepository
) {
}
public function findTenantByUuid(string $uuid): ?array
{
return $this->tenantRepository->findByUuid($uuid);
}
public function findTenantById(int $id): ?array
{
return $this->tenantRepository->find($id);
}
public function existsDepartmentCode(string $code): bool
{
return $this->departmentRepository->existsByCode($code);
}
public function existsDepartmentByTenantAndDescription(int $tenantId, string $description): bool
{
return $this->departmentRepository->existsByTenantAndDescription($tenantId, $description);
}
}