<?php

namespace App\Modules\Group\Infraestructure;

use App\Modules\Group\Domain\GroupGetTokenRepository;
use App\Modules\Group\Domain\GroupgGetToken;
use App\Modules\Group\Domain\IdGroup;
use Illuminate\Support\Facades\DB;

class MysqlGroupGetTokenRepository implements GroupGetTokenRepository {

    public function __invoke(IdGroup $idGroup) {
        return DB::select(
            'call sp_group_get_token(?)',
            [
                $idGroup->getValue()
            ]
        );
    }
}
