hristonev / sportmonks-client-bundle

Easily talk to an SportMonks API in PHP
MIT License
14 stars 7 forks source link

Fixtures and Its includes. #15

Open ils-rahulm opened 5 years ago

ils-rahulm commented 5 years ago

Hello,

I am using Fixtures endpoint with Includes localTeam, visitorTeam, and Odds,

How can I get a specific record for a bookmaker? I have asked the sportmonks support and they have suggested adding &bookmaker=2 in the request parameter.

Please help me to get this done in the query parameter.

Right Now I have done this.

` $scheme = SCHEME; $hostname = HOSTNAME; $subDomain = SUBDOMAIN; $port = PORT; $token = TOKEN;

    //Instantiate our class
    $client = new SportMonksAPI();

    //Set auth.
    $client->setAuth( Auth::BASIC, [
        'token' => $token,
    ] );

    $date_object = new DateTime( $date );

    $matches = $client->fixtures()->date()->day(
        $date_object,
        [
            'query' => [
                'include' => 'localTeam,visitorTeam,odds',
                'leagues' => $league_id,
                'bookmakers' => 2
            ],
        ] );

    $matches = PluginCore::sort_array_of_object( $matches );

    return $matches;`