Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dillchuk/zfcusersimplesettings
A solid little "user settings" addition to your ZfcUser Doctrine entity; with configurable defaults.
https://github.com/dillchuk/zfcusersimplesettings
Last synced: about 2 months ago
JSON representation
A solid little "user settings" addition to your ZfcUser Doctrine entity; with configurable defaults.
- Host: GitHub
- URL: https://github.com/dillchuk/zfcusersimplesettings
- Owner: dillchuk
- License: mit
- Created: 2017-11-11T18:12:24.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-13T23:37:52.000Z (about 7 years ago)
- Last Synced: 2024-04-23T15:21:40.107Z (9 months ago)
- Language: PHP
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ZfcUserSimpleSettings
[![Build Status](https://travis-ci.org/dillchuk/ZfcUserSimpleSettings.svg?branch=master)](https://travis-ci.org/dillchuk/ZfcUserSimpleSettings)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](config/zfcusersimplesettings.global.php.dist).
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.