danieledangeli / betfair-php

Betfair php library
http://danieledangeli.github.io/betfair-php
47 stars 30 forks source link

Filters are not working #18

Closed addic closed 7 years ago

addic commented 9 years ago

I have been trying out this library and i can not seem to get the filters or any parameters to work properly. Meaning, if i for example add a market filter, i still get results unaffected by the filter - all of them. Maybe i am doing something wrong, but i have spent quite some time trying this and that and it is just not working..

Small configuration:

$MARKETS = ["MATCH_ODDS", "CORRECT_SCORE", "HALF_TIME", "HALF_TIME_SCORE", "ASIAN_HANDICAP", "TOTAL_GOALS", "FIRST_HALF_GOALS_05", "FIRST_HALF_GOALS_15", "FIRST_HALF_GOALS_25", "OVER_UNDER_05", "OVER_UNDER_15", "OVER_UNDER_25", "OVER_UNDER_35", "OVER_UNDER_45", "OVER_UNDER_55"];
$COMPETITIONS = [7317506, 164952, 15, 3126267, 888275, 3085749, 892425, 4848838, 862638, 21, 1987477, 158146, 63, 840808, 1242586, 119, 121, 123, 125, 127, 2901699, 862545, 873203, 57, 111, 13051, 6294086, 3992967, 1985077, 219, 6301, 943450, 907589, 3126286, 83, 1587980, 1661891, 887178, 2609677, 827754, 836645, 5449376, 403085, 876442, 9513, 863810, 862579, 3006957, 880458, 101, 891179, 8141281, 920223, 4608865, 872215, 1888360, 1658999, 139, 3089001, 908196, 7897688, 3061353, 895129, 5618298, 857992, 844197, 65, 853948, 852459, 4556663, 4556656, 3792498, 3221481, 4040072, 17, 1842928, 311575, 4556576, 905441, 3127737, 879221, 827078, 1327393, 920858, 868392, 872270, 2938065, 115, 6103298, 175680, 7946082, 4732508, 1065530, 4517491, 1478090, 97807, 4431442, 821269, 2356065, 97, 32246, 103, 113, 194215, 843454, 7942109, 309948, 3729355, 13, 803690, 6566654, 887158, 7616742, 3242305, 839575, 842258, 4905, 4802204, 5448752, 1079277, 318343, 984404, 7197874, 3037492, 856134, 2079376, 59, 886734, 4802285, 1062024, 8053761, 7138694, 61351, 97855];
$IN_PLAY_ONLY = true;
$EVENT_TYPES = [1];

Queries:

(create betfair object) 
....
$marketCatalogue = $betfair->getBetfairMarketCatalogue();
$marketFilter = MarketFilter::create()
    ->setCompetitionIds($COMPETITIONS)
    ->setMarketBettingTypes($MARKETS)
    ->setInPlayOnly($IN_PLAY_ONLY);
return $marketCatalogue
    ->withMarketProjections(array(MarketProjection::EVENT))
    ->withMarketFilter($marketFilter)
    ->withMaxResult(1000)
    ->listMarketCatalogue($EVENT_TYPES);

Result:

This returns 99 results without event info (market projection), not in play events, not the specified competitions and all of the markets

....
[95] => Array
    (
        [marketId] => 1.118280148
        [marketName] => 2015/16 Winner
        [totalMatched] => 5419764.80794
    )

[96] => Array
    (
        [marketId] => 1.118280287
        [marketName] => Top 5 Finish 2015/16
        [totalMatched] => 19885.955712
    )

[97] => Array
    (
        [marketId] => 1.118280285
        [marketName] => Team to Score Most Goals 2015/16
        [totalMatched] => 11338.361174
    )

[98] => Array
    (
        [marketId] => 1.118280283
        [marketName] => Straight Tricast 2015/16
        [totalMatched] => 9909.808496
    )

[99] => Array
    (
        [marketId] => 1.118880359
        [marketName] => Top London Club 2015/16 - Please Read Rules
        [totalMatched] => 3020.681958
    )
addic commented 9 years ago

@danieledangeli any input?

danieledangeli commented 9 years ago

Sorry the late repsonse, I've been busy in the last month.

Let me check it!

addic commented 9 years ago

I have made my own solution and am not using this library anymore :). But as far as i remember, it did not apply the filters to the call