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