File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -149,6 +149,9 @@ focus on the most important methods that come from the
149
149
{
150
150
return serialize(array(
151
151
$this->id,
152
+ $this->username,
153
+ $this->salt,
154
+ $this->password,
152
155
));
153
156
}
154
157
@@ -159,10 +162,20 @@ focus on the most important methods that come from the
159
162
{
160
163
list (
161
164
$this->id,
165
+ $this->username,
166
+ $this->salt,
167
+ $this->password,
162
168
) = unserialize($serialized);
163
169
}
164
170
}
165
171
172
+ .. note ::
173
+
174
+ When implementing the
175
+ :class: `Symfony\\ Component\\ Security\\ Core\\ User\\ EquatableInterface `,
176
+ you determine yourself which properties need to be compared to distinguish
177
+ your user objects.
178
+
166
179
.. tip ::
167
180
168
181
:ref: `Generate the database table <book-doctrine-creating-the-database-tables-schema >`
@@ -573,7 +586,7 @@ methods have changed::
573
586
class User implements AdvancedUserInterface, \Serializable
574
587
{
575
588
// ...
576
-
589
+
577
590
/**
578
591
* @ORM\ManyToMany(targetEntity="Role", inversedBy="users")
579
592
*
@@ -589,7 +602,7 @@ methods have changed::
589
602
{
590
603
return $this->roles->toArray();
591
604
}
592
-
605
+
593
606
// ...
594
607
595
608
}
@@ -646,7 +659,7 @@ of the application::
646
659
{
647
660
return $this->role;
648
661
}
649
-
662
+
650
663
// ... getters and setters for each property
651
664
}
652
665
You can’t perform that action at this time.
0 commit comments