illchuk / zfc-user-simple-settings
A solid little "user settings" addition to your ZfcUser Doctrine entity; with configurable defaults.
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: 2025-01-08 12:33:02 UTC
README
A solid little "user settings" addition to your ZfcUser Doctrine entity; with configurable defaults.
Installation
Install with composer require illchuk/zfc-user-simple-settings
Then include in your modules.config.php
:
[..., 'ZfcUser', 'ZfcUserSimpleSettings', ...]
Finally, drop it into your User entity like the following:
class User extends ZfcEntityUser implements SettingsInterface {
use SettingsTrait;
// ...
}
Configuration
Configure the default values by installing the auto-config file.
Then add the lifecycle listener as follows:
'doctrine' => [
'eventmanager' => [
'orm_default' => [
'subscribers' => [
\ZfcUserSimpleSettings\Entity\Listener\SettingsLifecycle::class,
],
],
],
],
Bonus
This functionality can actually be applied to any Doctrine entity; ZfcUser isn't actually required.