Skip to content

Commit 74cf715

Browse files
committed
Merge branch '3.4' into 4.0
2 parents 06bb097 + 8b0087a commit 74cf715

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

security/guard_authentication.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ property they use to access their account via the API::
2727

2828
/**
2929
* @ORM\Entity
30-
* @ORM\Table(name="user")
30+
* @ORM\Table(name="`user`")
3131
*/
3232
class User implements UserInterface
3333
{
@@ -71,6 +71,13 @@ property they use to access their account via the API::
7171
// more getters/setters
7272
}
7373

74+
.. caution::
75+
76+
In the example above, the table name is ``user``. This is a reserved SQL
77+
keyword and `must be quoted with backticks`_ in Doctrine to avoid errors.
78+
You might also change the table name (e.g. with ``app_users``) to solve
79+
this issue.
80+
7481
.. tip::
7582

7683
This User doesn't have a password, but you can add a ``password`` property if
@@ -544,3 +551,5 @@ Frequently Asked Questions
544551
to actually authenticate the user. You can continue doing that (see previous
545552
question) or use the ``User`` object from FOSUserBundle and create your own
546553
authenticator(s) (just like in this article).
554+
555+
.. _`must be quoted with backticks`: http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/basic-mapping.html#quoting-reserved-words

0 commit comments

Comments
 (0)