PHP code example of vss / oauth-extension-bundle

1. Go to this page and download the library: Download vss/oauth-extension-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/ */

    

vss / oauth-extension-bundle example snippets

 php
namespace AppBundle\Security\Client;

use AppBundle\Entity\Client;
use AppBundle\Entity\PlayerRepository;
use Doctrine\ORM\EntityManagerInterface;
use Vss\OAuthExtensionBundle\Security\Utils\EmailProvider;

/**
 * Class ClientEmailProvider
 * @package AppBundle\Security
 */
class ClientEmailProvider implements EmailProvider {

    /**
     * @var \Doctrine\Common\Persistence\ObjectRepository
     */
    private $rep;

    /**
     * ClientEmailProvider constructor.
     * @param EntityManagerInterface $em
     */
    public function __construct(EntityManagerInterface $em) {
        $this->rep = $em->getRepository('AppBundle:Client');
    }

    /**
     * @inheritdoc
     */
    public function loadByEmail($email){
        return $this->rep->findOneBy(['email' => $email]);
    }
}