@@ -12,16 +12,19 @@ you how to load your users from the database via a Doctrine entity.
1212Introduction
1313------------
1414
15- Before you start, you should check out the `FOSUserBundle `_. This external
16- bundle allows you to load users from the database (like you'll learn here)
17- *and * gives you built-in routes and controllers for common things like login,
18- registration and forgot password. Whether you use that bundle or go through
19- the steps here is up to you.
15+ .. tip ::
16+
17+ Before you start, you should check out `FOSUserBundle `_. This external
18+ bundle allows you to load users from the database (like you'll learn here)
19+ *and * gives you built-in routes & controllers for things like login,
20+ registration and forgot password. But, if you need to heavily customize
21+ your user system *or * if you want to learn how things work, this tutorial
22+ is even better.
2023
2124Loading users via a Doctrine entity has 2 basic steps:
2225
23- 1 . :ref: `Create your User entity <security-crete-user-entity >`
24- 2 . :ref: `Configure security.yml to load from your entity <security-config-entity-provider >`
26+ # . :ref: `Create your User entity <security-crete-user-entity >`
27+ # . :ref: `Configure security.yml to load from your entity <security-config-entity-provider >`
2528
2629Afterwards, you can learn more about :ref: `forbidding inactive users <security-advanced-user-interface >`,
2730:ref: `using a custom query <authenticating-someone-with-a-custom-entity-provider >`
@@ -111,7 +114,7 @@ For this entry, suppose that you already have a ``User`` entity inside an
111114 {
112115 }
113116
114- /** * @see \Serializable::serialize() */
117+ /** @see \Serializable::serialize() */
115118 public function serialize()
116119 {
117120 return serialize(array(
@@ -123,7 +126,7 @@ For this entry, suppose that you already have a ``User`` entity inside an
123126 ));
124127 }
125128
126- /** * @see \Serializable::unserialize() */
129+ /** @see \Serializable::unserialize() */
127130 public function unserialize($serialized)
128131 {
129132 list (
@@ -174,7 +177,7 @@ On the next request, it's unserialized. To help PHP do this correctly, you
174177need to implement ``Serializable ``. But you don't need to serialize everything:
175178you only need a few fields (the ones shown above plus a few extra if you
176179decide to implement :ref: `AdvancedUserInterface <security-advanced-user-interface >`).
177- On each request, the ``username `` is used to query for a fresh ``User `` object
180+ On each request, the ``id `` is used to query for a fresh ``User `` object
178181from the database.
179182
180183Want to know more? See :ref: `cookbook-security-serialize-equatable `.
@@ -771,3 +774,4 @@ or worry about it.
771774 and the ``EquatableInterface `` was introduced in its place.
772775
773776.. _fixtures : http://symfony.com/doc/master/bundles/DoctrineFixturesBundle/index.html
777+ .. _FOSUserBundle : https://github.com/FriendsOfSymfony/FOSUserBundle
0 commit comments