2017 © Pedro Peláez
 

symfony-bundle lottoclient-bundle

Symfony2 bundle which helps connect to polish lotto server (Totalizator sportowy).

image

dwr/lottoclient-bundle

Symfony2 bundle which helps connect to polish lotto server (Totalizator sportowy).

  • Saturday, March 4, 2017
  • by dwr
  • Repository
  • 1 Watchers
  • 0 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

SensioLabsInsight

Build Status Scrutinizer Code Quality, (*1)

DwrLottoClient

This bundle helps to take results from polish national lottery, (*2)

Installation

Installation is a quick 3 steps process:, (*3)

  1. Download DwrLottoClientBundle using composer.
  2. Enable the Bundle.
  3. Use bundle in your controller.

Step 1: Download DwrAvatarBundle using composer

Add DwrGlobalWeatherBundle in your composer.json:, (*4)

``` js { "require": { "dwr/lottoclient-bundle": "1.0" } }, (*5)


Download the bundle by running the command: ``` bash $ php composer.phar require dwr/lottoclient-bundle

Composer will install the bundle into your project's vendor/dwr/lottoclient-bundle directory., (*6)

Step 2: Enable the bundle

Enable the bundle in the kernel:, (*7)

``` php //app/AppKernel.php, (*8)

public function registerBundles() { $bundles = array( // ... new Dwr\LottoClientBundle\DwrLottoClientBundle(), ); }, (*9)


### Step 3: Use bundle in your controller ``` php use Dwr\LottoClientBundle\Service\LottoClient; //don't forget add this line above class declaration /** * @Route("/", name="homepage") */ public function indexAction() { $lotto = $this->get('dwr_lotto_client'); $resultsDL = $lotto->getRecentlyResults(LottoClient::DUZY_LOTEK, 1); //takes last result from Duży lotek $resultsK = $lotto->getRecentlyResults(LottoClient::KASKADA, 5); //takes 5 recently results from Kaskada var_dump($resultsDL); var_dump($resultsK); $date = new \DateTime('2014-10-10'); $resultMINI = $lotto->getResultsByDate($date, LottoClient::MINI_LOTEK, 2); //takes 2 recently results from giving date for Mini Lotek $resultMULTI = $lotto->getResultsByDate($date, LottoClient::MULTI_LOTEK, 3); //takes 3 recently results from giving date for Multi Lotek var_dump($resultMINI); var_dump($resultMULTI); return $this->render('default/index.html.twig'); }

Congratulations! You're ready to embed lotto results in your symfony2 application., (*10)

Usage

Add this in your controller:, (*11)

``` php, (*12)

use Dwr\LottoClientBundle\Service\LottoClient; //don't forget add this line above class declaration

/**
 * @Route("/", name="homepage")
 */
public function indexAction()
{

    $lotto = $this->get('dwr_lotto_client');

    /**
     * In order to take last result from Duży lotek pass 1 as a second argument for getRecentlyResults method.
     * Maximum you can take 10 recently results.
     */
    $resultsDL = $lotto->getRecentlyResults(LottoClient::DUZY_LOTEK, 1);
    var_dump($resultsDL); 

    /**
     * In order to take archive results use getResultsByDate method.
     * Specify date (e.g. new \DateTime('2014-10-10')) and pass it as first argument.
     */
    $date = new \DateTime('2014-10-10');
    $resultMINI = $lotto->getResultsByDate($date, LottoClient::MINI_LOTEK, 2);
    var_dump($resultMINI);
}

```, (*13)

Available lottery types:

LottoClient::DUZY_LOTEK
LottoClient::MINI_LOTEK
LottoClient::MULTI_LOTEK
LottoClient::JOKER
LottoClient::KASKADA, (*14)

The Versions

04/03 2017

dev-master

9999999-dev https://github.com/dariuszwrzesien/DwrLottoClientBundle

Symfony2 bundle which helps connect to polish lotto server (Totalizator sportowy).

  Sources   Download

MIT

The Requires

 

lotto totalizator sportowy totek wyniki lotto

06/08 2015

1.0

1.0.0.0 https://github.com/dariuszwrzesien/DwrLottoClientBundle

Symfony2 bundle which helps connect to polish lotto server (Totalizator sportowy).

  Sources   Download

MIT

The Requires

 

lotto totalizator sportowy totek wyniki lotto

31/07 2015

0.1

0.1.0.0 https://github.com/dariuszwrzesien/DwrLottoClientBundle

Symfony2 bundle which helps connect to polish lotto server (Totalizator sportowy).

  Sources   Download

MIT

The Requires

 

The Development Requires

lotto totalizator sportowy totek wyniki lotto