File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -1191,6 +1191,12 @@ is defined by the ``target`` parameter above (e.g. the ``homepage``).
11911191Dynamically Encoding a Password
11921192-------------------------------
11931193
1194+ .. note ::
1195+
1196+ For historical reasons, Symfony uses the term *"password encoding" * when it
1197+ should really refer to *"password hashing" *. The "encoders" are in fact
1198+ `cryptographic hash functions `_.
1199+
11941200If, for example, you're storing users in the database, you'll need to encode
11951201the users' passwords before inserting them. No matter what algorithm you
11961202configure for your user object, the hashed password can always be determined
@@ -1396,5 +1402,6 @@ Learn More from the Cookbook
13961402
13971403.. _`frameworkextrabundle documentation` : https://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/index.html
13981404.. _`security advisories database` : https://github.com/FriendsOfPHP/security-advisories
1405+ .. _`cryptographic hash functions` : https://en.wikipedia.org/wiki/Cryptographic_hash_function
13991406.. _`HWIOAuthBundle` : https://github.com/hwi/HWIOAuthBundle
14001407.. _`SensioDistributionBundle` : https://packagist.org/packages/sensio/distribution-bundle
Original file line number Diff line number Diff line change @@ -192,14 +192,21 @@ instead of the ``default`` entity manager.
192192query_builder
193193~~~~~~~~~~~~~
194194
195- **type **: ``Doctrine\ORM\QueryBuilder `` or a Closure
195+ **type **: ``Doctrine\ORM\QueryBuilder `` or a Closure ** default **: `` null ``
196196
197197Allows you to create a custom query for your choices. See
198198:ref: `ref-form-entity-query-builder ` for an example.
199199
200- The value of this option can either be a ``QueryBuilder `` object or a Closure.
201- When using a Closure, you will be passed the ``EntityRepository `` of the entity
202- as the only argument and should return a ``QueryBuilder ``.
200+ The value of this option can either be a ``QueryBuilder `` object, a Closure or
201+ ``null `` (which will load all entities). When using a Closure, you will be
202+ passed the ``EntityRepository `` of the entity as the only argument and should
203+ return a ``QueryBuilder ``.
204+
205+ If you'd like to display an empty list of entries, you can return ``null `` in
206+ the Closure.
207+
208+ .. versionadded :: 2.8
209+ Returning ``null `` in the Closure was introduced in Symfony 2.8.
203210
204211Overridden Options
205212------------------
You can’t perform that action at this time.
0 commit comments