public function searchWithExBestOffer($appKey, $username, $pwd)
 {
     $betfair = BetfairFactory::createBetfair($appKey, $username, $pwd);
     $marketBookBetfair = $betfair->getBetfairMarketBook();
     $priceProjection = new PriceProjection(array(\Betfair\Model\PriceData::EX_BEST_OFFERS));
     $marketBookBetfair->withPriceProjection($priceProjection)->withMarketIds(array(1.117549116));
     $results = $marketBookBetfair->getResults();
     return $results;
 }
 public function searchClearedOrder($appKey, $username, $pwd)
 {
     $betfair = BetfairFactory::createBetfair($appKey, $username, $pwd);
     $clearedOrder = $betfair->getBetfairClearedOrder();
     $param = $clearedOrder->createParam();
     $param->setBetStatus(BetStatus::SETTLED);
     $clearedOrder->withParam($param);
     $results = $clearedOrder->getResults();
     return $results;
 }
 public function searchEventsWithTimeRange($appKey, $username, $pwd)
 {
     $betfair = BetfairFactory::createBetfair($appKey, $username, $pwd);
     $from = new DateTime('now + 1 month');
     $to = new DateTime("now + 1 month + 1 day");
     $timeZone = new \Betfair\Model\TimeRange($from, $to);
     $marketFilter = MarketFilter::create()->setMarketStartTime($timeZone);
     $betfairEvent = $betfair->getBetfairEvent()->withMarketFilter($marketFilter);
     return $betfairEvent->getResults();
 }