// Otherwise, an incrementing integer is used as name automatically
return null;
};
// The choices are always indexed by ID (see "choices" normalizer
// and DoctrineChoiceLoader), unless the ID is composite. Then they
// are indexed by an incrementing integer.
// Use the ID/incrementing integer as choice value.
$choiceValue =
function DOptions
$options) { // If the entity has a single-column ID, use that ID as value
if ($options['id_reader'
] instanceof IdReader &&
$options['id_reader'
]->
isSingleId()) { return ChoiceList::
value($this,
$options['id_reader'
]->
getIdValue(...
),
$options['id_reader'
]);
} // Otherwise, an incrementing integer is used as value automatically
return null;
};
$emNormalizer =
function DOptions
$options,
$em) { if (null !==
$em) { if ($em instanceof ObjectManager
) { return $em;
}