),
$vary);
} return null;
};
$choiceName =
function DOptions
$options) { // If the object has a single-column, numeric ID, use that ID as
// field name. We can only use numeric IDs as names, as we cannot
// guarantee that a non-numeric ID contains a valid form name
if ($options['id_reader'
] instanceof IdReader &&
$options['id_reader'
]->
isIntId()) { return ChoiceList::
fieldName($this,
[__CLASS__, 'createChoiceName'
]);
} // 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.