Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd1ca515

Browse files
raziel057weaverryan
authored andcommitted
Update entity.rst
1 parent5bc48ab commitd1ca515

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
@@ -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)

[8]ページ先頭

©2009-2025 Movatter.jp