File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,23 @@ This is the property that should be used for displaying the entities
96
96
as text in the HTML element. If left blank, the entity object will be
97
97
cast into a string and so must have a ``__toString() `` method.
98
98
99
+ Note: ``property `` is the property path used to display the option. So you
100
+ can use anything supported by the :doc: `PropertyAccessor component</components/property_access/introduction> `
101
+
102
+ Usage sample:
103
+
104
+ $builder->add('gender', 'entity', array(
105
+ 'class' => 'MyBundle:Gender',
106
+ 'property' => 'translations[en].name',
107
+ 'query_builder' => function(EntityRepository $er) {
108
+ return $er->createQueryBuilder('g')
109
+ ->join('g.translations', 't')
110
+ ->where('t.locale = :locale')
111
+ ->orderBy('t.name', 'ASC')
112
+ ->setParameter('locale', 'en');
113
+ },
114
+ ));
115
+
99
116
group_by
100
117
~~~~~~~~
101
118
You can’t perform that action at this time.
0 commit comments