illchuk / zfc-user-simple-settings
为您的 ZfcUser Doctrine 实体添加的一个坚实的“用户设置”补充;具有可配置的默认值。
v0.2
2017-11-12 02:16 UTC
Requires
- php: ^5.6|^7.0
- beaucal/beaucal-util: ^0.1
- doctrine/doctrine-orm-module: ^1.0
- doctrine/orm: ^2.5
- phpoption/phpoption: ^1.0
Requires (Dev)
- fzaninotto/faker: ^1.7
- phpunit/dbunit: 2.0.x-dev
- phpunit/phpunit: ~4.0
- zendframework/zend-db: ^2.6
- zendframework/zend-servicemanager: ^3.0
This package is auto-updated.
Last update: 2024-09-08 11:48:26 UTC
README
为您的 ZfcUser Doctrine 实体添加的一个坚实的“用户设置”补充;具有可配置的默认值。
安装
使用以下命令安装:composer require illchuk/zfc-user-simple-settings
然后将其包含在您的 modules.config.php
文件中
[..., 'ZfcUser', 'ZfcUserSimpleSettings', ...]
最后,将其添加到您的用户实体中,如下所示
class User extends ZfcEntityUser implements SettingsInterface {
use SettingsTrait;
// ...
}
配置
通过安装以下自动配置文件来配置默认值。
然后添加以下生命周期监听器
'doctrine' => [
'eventmanager' => [
'orm_default' => [
'subscribers' => [
\ZfcUserSimpleSettings\Entity\Listener\SettingsLifecycle::class,
],
],
],
],
附加功能
此功能实际上可以应用于任何 Doctrine 实体;ZfcUser 并非必需。