Skip to content

Commit 46f1b8b

Browse files
committed
Update entity.rst
1 parent 7496e68 commit 46f1b8b

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

reference/forms/types/entity.rst

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,17 +102,12 @@ cast into a string and so must have a ``__toString()`` method.
102102
can use anything supported by the
103103
:doc:`PropertyAccessor component </components/property_access/introduction>`
104104

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

107108
$builder->add('gender', 'entity', array(
108109
'class' => 'MyBundle:Gender',
109110
'property' => 'translations[en].name',
110-
'query_builder' => function(EntityRepository $er) {
111-
return $er->createQueryBuilder('g')
112-
->join('g.translations', 't', 'WITH', 't.locale = :locale')
113-
->orderBy('t.name', 'ASC')
114-
->setParameter('locale', 'en');
115-
},
116111
));
117112

118113
group_by

0 commit comments

Comments
 (0)