ArrayChoiceList::getOriginalKeys()

int[]|string[] getOriginalKeys()

Returns the original keys of the choices.

The original keys are the keys of the choice array that was passed in the "choice" option of the choice type. Note that this array may contain duplicates if the "choice" option contained choice groups:

$form->add('field', 'choice', array(
    'choices' => array(
        'Decided' => array(true, false),
        'Undecided' => array(null),
    ),
));

In this example, the original key 0 appears twice, once for true and once for null.

Return Value

int[]|string[] The original choice keys indexed by the corresponding choice values
doc_Symfony
2016-10-28 06:05:49
Comments
Leave a Comment

Please login to continue.