, (*1)
DCSUserCoreBundle
The DCSUserCoreBundle is the main part of a set of libraries that help you in the most common
tasks for managing users., (*2)
It provides the abstraction of operations such as saving, deleting and searching for a single user.
As? Through specific events., (*3)
Note: This bundle does not provide the final implementation of the operations but you must add and configure libraries (or create your own) to ensure the execution of commands., (*4)
Introduction
This bundle offers a number of services which in itself do not develop the entire operating logic, but they need of external services to work., (*5)
The list of exposed services is as follows:, (*6)
dcs_user.manager.save
dcs_user.manager.delete
dcs_user.factory
dcs_user.repository
Services
The managers
The dcs_user.manager.save
and dcs_user.manager.delete
services do not perform the save or cancellation but emit a series of the events that can be used to perform the real action., (*7)
The factory
The dcs_user.factory
has the task of creating a new user instance., (*8)
The repository
The dcs_user.repository
is only an interface that exposes methods for the user's search. It must be implemented as a service and added in the bundle configuration., (*9)
Events
Listeners hooked to events emitted by the various services will always receive an instance of DCS\User\CoreBundle\Event\UserEvent
., (*10)
The complete list of events is within the class DCS\User\CoreBundle\DCSUserCoreEvents
., (*11)
The DCS bundles
Several bundles have been developed that help you perform common tasks for user management:, (*12)
Persistence
DCSUserPersistenceORMBundle, (*13)
This bundle provides you the implementation of the persistence on database using Doctrine ORM. Requirerment: DCSUserCoreBundle., (*14)
Role management
DCSRoleCoreBundle, (*15)
This bundle provides the basic services for the role management. Requirerment: DCSUserCoreBundle., (*16)
DCSRoleProviderORMBundle, (*17)
This bundle provides you with the management of user roles using Doctrine ORM. Requirerment: DCSRoleCoreBundle., (*18)
DCSRoleProviderArrayBundle, (*19)
This bundle provides you with the management of roles having the configuration as an array. Requirerment: DCSRoleCoreBundle., (*20)
Security
DCSSecurityCoreBundle, (*21)
This bundle provides the basic services for the management of security. Requirerment: DCSUserCoreBundle., (*22)
DCSSecurityAuthFormBundle, (*23)
This bundle provides an authentication system using the login form. Requirerment: DCSSecurityCoreBundle., (*24)
Password reset management
DCSPasswordResetCoreBundle, (*25)
This bundle provides the logic to perform a complete flow of password change request. Requirerment: DCSUserCoreBundle, DCSSecurityCoreBundle., (*26)
DCSPasswordResetPersistenceORMBundle, (*27)
This bundle provides the implementation of the persistence on database using Doctrine ORM of all password requests. Requirerment: DCSPasswordResetCoreBundle., (*28)
DCSPasswordResetExplainViewBundle, (*29)
This bundle provides the visual display of password recovery services through view and form. Requirerment: DCSPasswordResetCoreBundle., (*30)
Prerequisites
This version of the bundle requires Symfony 2.8+., (*31)
Installation
Require the bundle
Run the following command:, (*32)
$ composer require dcs/user-core-bundle "~1.0@dev"
Composer will install the bundle to your project's vendor/dcs/user-core-bundle
directory., (*33)
Enable the bundle
Enable the bundle in the kernel:, (*34)
<?php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new DCS\User\CoreBundle\DCSUserCoreBundle(),
// ...
);
}
Create your User class
Until now he has never talked about persistence. This because? Why DCSUserCoreBundle not know the logic of how they will be implemented the Save and Delete methods. It is allowed total freedom of implementation., (*35)
Now that you have properly enabled this bundle, the next step is to configure it to work with the specific needs of your application., (*36)
Add the following configuration to your config.yml
., (*37)
dcs_user_core:
model_class: Your\User\Class
repository_service: your_repository_service
Reporting an issue or a feature request
Issues and feature requests are tracked in the Github issue tracker., (*38)