Skip to content

Commit af5e795

Browse files
committed
Merge branch '4.2'
* 4.2: Update entity.rst
2 parents ed8c8dc + 2574794 commit af5e795

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

reference/forms/types/entity.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,14 @@ more details, see the main :ref:`choice_label <reference-form-choice-label>` doc
177177
:doc:`PropertyAccessor component </components/property_access>`
178178

179179
For example, if the translations property is actually an associative
180-
array of objects, each with a name property, then you could do this::
180+
array of objects, each with a ``name`` property, then you could do this::
181181

182+
use App\Entity\Genre;
182183
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
183184
// ...
184185

185186
$builder->add('genre', EntityType::class, [
186-
'class' => 'App\Entity\Genre',
187+
'class' => Genre::class,
187188
'choice_label' => 'translations[en].name',
188189
]);
189190

0 commit comments

Comments
 (0)