Skip to content

Commit d1ca515

Browse files
raziel057weaverryan
authored andcommitted
Update entity.rst
1 parent 5bc48ab commit d1ca515

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

reference/forms/types/entity.rst

+2-7
Original file line numberDiff line numberDiff line change
@@ -124,17 +124,12 @@ cast into a string and so must have a ``__toString()`` method.
124124
can use anything supported by the
125125
:doc:`PropertyAccessor component </components/property_access/introduction>`
126126

127-
Usage sample::
127+
For example, if the translations property is actually an associative array of
128+
objects, each with a name property, then you could do this::
128129

129130
$builder->add('gender', 'entity', array(
130131
'class' => 'MyBundle:Gender',
131132
'property' => 'translations[en].name',
132-
'query_builder' => function(EntityRepository $er) {
133-
return $er->createQueryBuilder('g')
134-
->join('g.translations', 't', 'WITH', 't.locale = :locale')
135-
->orderBy('t.name', 'ASC')
136-
->setParameter('locale', 'en');
137-
},
138133
));
139134

140135
group_by

0 commit comments

Comments
 (0)