diff --git a/cookbook/security/entity_provider.rst b/cookbook/security/entity_provider.rst index 80e0b08270b..40f88eb2bae 100644 --- a/cookbook/security/entity_provider.rst +++ b/cookbook/security/entity_provider.rst @@ -358,6 +358,69 @@ entity user provider to load User entity objects from the database by using the ``username`` unique field. In other words, this tells Symfony how to fetch the user from the database before checking the password validity. +.. note:: + + By default, the entity provider uses the default entity manager to fetch + user information from the database. If you, + :doc:`use multiple entity managers `, + you can specify which manager to use with the ``manager_name`` option: + + .. configuration-block:: + + .. code-block:: yaml + + # app/config/config.yml + security: + # ... + + providers: + administrators: + entity: + class: AcmeUserBundle:User + property: username + manager_name: customer + + # ... + + .. code-block:: xml + + + + + + + + + + + + + + + + .. code-block:: php + + // app/config/config.php + $container->loadFromExtension('security', array( + // ... + 'providers' => array( + 'administrator' => array( + 'entity' => array( + 'class' => 'AcmeUserBundle:User', + 'property' => 'username', + 'manager_name' => 'customer', + ), + ), + ), + // ... + )); + Forbid inactive Users ---------------------