indigophp / guardian-doctrine
此包已被废弃,不再维护。作者建议使用 guardianphp/doctrine-integration 包。
Guardian 的 Doctrine 集成
dev-master / 0.1.x-dev
2015-03-30 00:27 UTC
Requires
- php: >=5.4
- doctrine/orm: ~2.4
- indigophp/guardian: 0.1.*@dev
Requires (Dev)
- henrikbjorn/phpspec-code-coverage: ~1.0
- phpspec/phpspec: ~2.1
This package is not auto-updated.
Last update: 2022-02-01 12:46:01 UTC
README
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)。请参阅 许可文件 了解更多信息。