This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Bridge/Doctrine
Fabien Potencier 1aaf5c9423 merged branch marcw/patch-security-refresh-user (PR #3402)
Commits
-------

10947cb [DoctrineBridge][Security] Fixes bug that prevents repository's refreshUser from being called

Discussion
----------

[Security][DoctrineBridge] Fixes bug that prevents repository's refreshUser from being called

---------------------------------------------------------------------------

by marcw at 2012-02-21T08:46:09Z

Updated. What do you guys think about this patch ?

---------------------------------------------------------------------------

by henrikbjorn at 2012-02-21T08:57:47Z

Isnt this a bit dangerous, the custom repository implementing refreshUser should always be called first right? You wouldnt specify the $property property if your class has custom implementations would you?

---------------------------------------------------------------------------

by marcw at 2012-02-21T09:05:08Z

@henrikbjorn At this time, the refreshUser method is never called from the custom repository, even if you don't specify the "property" property. This patch fixes this.

---------------------------------------------------------------------------

by marcw at 2012-02-21T09:44:06Z

Updated & Squashed.

---------------------------------------------------------------------------

by stof at 2012-02-21T10:03:33Z

@marcw please move the retrieval of the id in the ``else`` block, like in my comment as it is useless to do this logic for the case where the userProviderInterface is implemented (and it will answer to @vicb by making it impossible to write it with elseif)

---------------------------------------------------------------------------

by marcw at 2012-02-21T10:19:06Z

I'm not sure about this, but Isn't the check of the id essential here to ensure that the entity is a persisted one ?

---------------------------------------------------------------------------

by stof at 2012-02-21T10:21:55Z

@marcw if the interface is used, it means that the user wants to do the work himself. So you should really let him do the way he wants. If he does not use the id to refresh the user, he could choose not to include it in the serialized data.
Retrieving the id is needed for the ``find()`` call because we pass the id as argument and so we fail when the serialized data don't contain it

---------------------------------------------------------------------------

by marcw at 2012-02-21T10:33:30Z

@stof Roger that. I'll do the fix.

---------------------------------------------------------------------------

by marcw at 2012-02-21T10:41:58Z

Updated & Squashed, again.

---------------------------------------------------------------------------

by stof at 2012-02-21T11:00:44Z

btw, to answer to your previous question, the exception when retrieving the id does not check if the object is persisted (you need to reach teh DB for this, which is what find() does) but that the id is part of the serialized data to give a better error reporting.

---------------------------------------------------------------------------

by fabpot at 2012-03-07T19:39:33Z

ready to be merged now?

---------------------------------------------------------------------------

by henrikbjorn at 2012-03-08T07:21:37Z

would say so.

---------------------------------------------------------------------------

by dlsniper at 2012-03-25T11:58:34Z

Hi, can this be merged now or not?
2012-03-26 09:36:13 +02:00
..
CacheWarmer [DoctrineBridge] Updated the code to use the new registry 2011-10-16 14:57:14 +02:00
DataCollector [DoctrineBridge] Refactored the query sanitization in the collector 2012-01-23 10:57:46 +01:00
DataFixtures [DoctrineBridge] Rename data fixtures loader class 2012-02-11 16:48:09 -05:00
DependencyInjection [DoctrineBridge] Compiler pass for registering event listeners/subscribers 2012-02-23 17:50:43 -05:00
Form [Form] Fix min/max length guessing for numeric types (fix #3091) 2012-03-19 23:57:21 +01:00
HttpFoundation [DoctrineBridge] Refactor session storage to handler. 2012-03-14 20:27:23 +05:45
Logger [DoctrineBridge][DoctrineBundle] Refactored the DBAL logging 2011-12-16 14:57:00 +01:00
Security/User [DoctrineBridge][Security] Fixes bug that prevents repository's refreshUser from being called 2012-02-21 13:38:07 +01:00
Validator [DoctrineBridge] Iterator->current() is not the same as current(Iterator) 2012-03-09 10:27:18 -05:00
composer.json merged 2.0 2012-03-11 18:00:10 +01:00
ContainerAwareEventManager.php fixed CS 2012-03-11 18:00:25 +01:00
ManagerRegistry.php fixed getting the alias for a namespace 2011-09-25 14:23:16 +02:00
README.md tweaked the README files 2011-12-18 14:22:28 +01:00
RegistryInterface.php [DoctrineBridge] fixed some CS 2011-12-13 10:22:12 +01:00

Doctrine Bridge

Provides integration for Doctrine with various Symfony2 components.

Resources

Unit tests:

https://github.com/symfony/symfony/tree/master/tests/Symfony/Tests/Bridge/Doctrine