private function createConnection() { if (is_null($this->lotteryType) or is_null($this->raffleDate)) { throw new ResultParameterException('Lottery type and/or raffle date parameter null, use set parameter with this class setOption method'); } return new MpiConnection(new ConnectionConstants(ConnectionConstants::getConstant($this->lotteryType)), $this->raffleDate); }