PHP code example of avoo / elo-bundle

1. Go to this page and download the library: Download avoo/elo-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

avoo / elo-bundle example snippets

 php
// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new Avoo\EloBundle\AvooEloBundle(),
        new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
    );
}
 php
namespace Avoo\EloBundle\Entity;

use Avoo\EloBundle\Entity\EloPlayer as BaseEloPlayer;
use Doctrine\ORM\Mapping as ORM;

class EloPlayer extends BaseEloPlayer
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @ORM\OneToOne(targetEntity="AppBundle\Entity\User", inversedBy="eloPlayer")
     * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
     */
    protected $user;
}
 php
use Avoo\Elo\Model\EloUserInterface;

class User implements EloUserInterface
{
    /**
     * @var EloPlayerInterface $eloPlayer
     */
    protected $eloPlayer;

    /**
     * Get elo player
     *
     * @return EloPlayerInterface
     */
    public function getEloPlayer()
    {
        return $this->eloPlayer;
    }
}
 php

use Avoo\Elo\Model\EloUserInterface;
use Doctrine\ORM\Mapping as ORM;

class User implements EloUserInterface
{
    /**
     * @ORM\OneToOne(targetEntity="AppBundle\Entity\EloPlayer", mappedBy="user")
     */
    protected $eloPlayer;
}