guardianphp/doctrine-integration

dev-master / 0.1.x-dev 2015-06-19 02:25 UTC

README

Latest Version Software License Build Status Code Coverage Quality Score Total Downloads

Doctrine integration for Guardian.

Install

Via Composer

$ composer require guardianphp/doctrine-integration

Usage

Simply pass an EntityManagerInterface instance and an Entity class name to the Guardian\Doctrine\DoctrineIdentifier class and you are good to go:

use Guardian\Doctrine\DoctrineIdentifier;

$identifier = new DoctrineIdentifier($entityManager, 'Guardian\User\Caller\User');

// optional, ['username'] by default
$identifier->setIdentificationFields(['username']);

// optional, 'loginToken' by default
$identifier->setLoginTokenField('id');

Testing

$ phpspec run

Security

If you discover any security related issues, please contact us at security@guardianphp.org.

Credits

License

The MIT License (MIT). Please see License File for more information.