8000 [#2935] Enhancing note about using a repository to build a QB or to j… · symfony/symfony-docs@dcc1c52 · GitHub
[go: up one dir, main page]

Skip to content

Commit dcc1c52

Browse files
committed
[#2935] Enhancing note about using a repository to build a QB or to just call a function return the QB
1 parent 5fc3920 commit dcc1c52

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cookbook/form/dynamic_form_modification.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,11 @@ and fill in the listener logic::
280280
'property' => 'fullName',
281281
'query_builder' => function(EntityRepository $er) use ($user) {
282282
// build a custom query
283+
// return $er->createQueryBuilder('u')->addOrderBy('fullName', 'DESC');
284+
285+
// or call a method on your repository that returns the query builder
286+
// the $er is an instance of your UserRepository
287+
// return $er->createOrderByFullNameQueryBuilder();
283288
},
284289
);
285290

0 commit comments

Comments
 (0)
0