. */ namespace SP\Domain\Account\Services; use SP\Core\Application; use SP\Domain\Account\Ports\AccountToUserRepository; use SP\Domain\Account\Ports\AccountToUserService; use SP\Domain\Common\Models\Item; use SP\Domain\Common\Services\Service; use SP\Domain\Core\Exceptions\ConstraintException; use SP\Domain\Core\Exceptions\QueryException; use SP\Domain\Core\Exceptions\SPException; /** * Class AccountToUser */ final class AccountToUser extends Service implements AccountToUserService { public function __construct( Application $application, private readonly AccountToUserRepository $accountToUserRepository ) { parent::__construct($application); } /** * @param int $id * * @return Item[] * @throws ConstraintException * @throws QueryException * @throws SPException */ public function getUsersByAccountId(int $id): array { return $this->accountToUserRepository->getUsersByAccountId($id)->getDataAsArray(); } }