indigophp / guardian-doctrine

此包已被废弃,不再维护。作者建议使用 guardianphp/doctrine-integration 包。

Guardian 的 Doctrine 集成

dev-master / 0.1.x-dev 2015-03-30 00:27 UTC

This package is not auto-updated.

Last update: 2022-02-01 12:46:01 UTC


README

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

Guardian 的 Doctrine 集成。

安装

通过 Composer

$ composer require indigophp/guardian-doctrine

使用方法

只需将一个 EntityManagerInterface 实例和一个实体类名传递给 Indigo\Guardian\Identifier\Doctrine 类即可。

use Indigo\Guardian\Identifier\Doctrine;

$identifier = new Doctrine($entityManager, 'Indigo\Guardian\Caller\User\Simple');

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

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

测试

$ phpspec run

贡献

请参阅 CONTRIBUTING 了解详情。

致谢

许可

MIT 许可证 (MIT)。请参阅 许可文件 了解更多信息。