1 | <?php |
||
7 | class Betting |
||
8 | { |
||
9 | const ENDPOINT = 'https://api.betfair.com/exchange/betting/rest/v1.0/'; |
||
10 | |||
11 | protected $httpClient; |
||
12 | |||
13 | public function __construct(HttpClient $httpClient = null) |
||
17 | |||
18 | public function listMarketcatalogue($filter = [ ], $marketProjection = [ ], $sort = null, $maxResults = 100, $locale = null) |
||
32 | |||
33 | public function listMarketBook($marketIds = [ ], $priceProjection = null, $orderProjection = null, $matchProjection = null, $currencyCode = null, $locale = null) |
||
48 | |||
49 | public function listMarketProfitAndLoss($marketIds = [ ], $includeSettledBets = false, $includeBspBets = false, $netOfCommission = false) |
||
50 | { |
||
51 | return $this->httpClient |
||
52 | ->setMethod('post') |
||
53 | ->setEndPoint(self::ENDPOINT.'listMarketProfitAndLoss/') |
||
54 | ->authHeaders() |
||
55 | ->addHeader([ 'Content-Type' => 'application/json' ]) |
||
56 | ->setMarketIds($marketIds, true) |
||
57 | ->setFlag('includeSettledBets', $includeSettledBets) |
||
58 | ->setFlag('includeBspBets', $includeBspBets) |
||
59 | ->setFlag('netOfCommission', $netOfCommission) |
||
60 | ->send(); |
||
61 | } |
||
62 | |||
63 | public function listTimeRanges($marketFilter, $timeGranularity) |
||
74 | |||
75 | public function listCurrentOrders($betIds = null, $marketIds = null, $orderProjection = null, $placedDateRange = null, $dateRange = null, $orderBy = null, $sortDir = null, $fromRecord = null, $recordCount = null) |
||
91 | |||
92 | /** |
||
93 | * Six Exchange methods have an identical API, so we bundle them into a single magic call e.g. |
||
94 | * @method listCompetitions(array $filters, string $locale) |
||
95 | * @return array |
||
96 | */ |
||
97 | public function __call($method, $params) |
||
114 | } |
||
115 |