[Form] Deprecated ChoiceList::getIndicesFor*() methods
This commit is contained in:
parent
67ba131458
commit
9efdb8e5d0
|
@ -162,6 +162,12 @@ UPGRADE FROM 2.x to 3.0
|
||||||
`NumberToLocalizedStringTransformer` were renamed to `ROUND_HALF_EVEN`,
|
`NumberToLocalizedStringTransformer` were renamed to `ROUND_HALF_EVEN`,
|
||||||
`ROUND_HALF_UP` and `ROUND_HALF_DOWN`.
|
`ROUND_HALF_UP` and `ROUND_HALF_DOWN`.
|
||||||
|
|
||||||
|
* The methods `ChoiceListInterface::getIndicesForChoices()` and
|
||||||
|
`ChoiceListInterface::getIndicesForValues()` were removed. No direct
|
||||||
|
replacement exists, although in most cases
|
||||||
|
`ChoiceListInterface::getChoicesForValues()` and
|
||||||
|
`ChoiceListInterface::getValuesForChoices()` should be sufficient.
|
||||||
|
|
||||||
|
|
||||||
### FrameworkBundle
|
### FrameworkBundle
|
||||||
|
|
||||||
|
|
|
@ -279,6 +279,8 @@ class EntityChoiceList extends ObjectChoiceList
|
||||||
* @return array
|
* @return array
|
||||||
*
|
*
|
||||||
* @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface
|
* @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface
|
||||||
|
*
|
||||||
|
* @deprecated Deprecated since version 2.4, to be removed in 3.0.
|
||||||
*/
|
*/
|
||||||
public function getIndicesForChoices(array $entities)
|
public function getIndicesForChoices(array $entities)
|
||||||
{
|
{
|
||||||
|
@ -314,6 +316,8 @@ class EntityChoiceList extends ObjectChoiceList
|
||||||
* @return array
|
* @return array
|
||||||
*
|
*
|
||||||
* @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface
|
* @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface
|
||||||
|
*
|
||||||
|
* @deprecated Deprecated since version 2.4, to be removed in 3.0.
|
||||||
*/
|
*/
|
||||||
public function getIndicesForValues(array $values)
|
public function getIndicesForValues(array $values)
|
||||||
{
|
{
|
||||||
|
|
|
@ -252,6 +252,8 @@ class ModelChoiceList extends ObjectChoiceList
|
||||||
* @return array
|
* @return array
|
||||||
*
|
*
|
||||||
* @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface
|
* @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface
|
||||||
|
*
|
||||||
|
* @deprecated Deprecated since version 2.4, to be removed in 3.0.
|
||||||
*/
|
*/
|
||||||
public function getIndicesForChoices(array $models)
|
public function getIndicesForChoices(array $models)
|
||||||
{
|
{
|
||||||
|
@ -310,6 +312,8 @@ class ModelChoiceList extends ObjectChoiceList
|
||||||
* @return array
|
* @return array
|
||||||
*
|
*
|
||||||
* @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface
|
* @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface
|
||||||
|
*
|
||||||
|
* @deprecated Deprecated since version 2.4, to be removed in 3.0.
|
||||||
*/
|
*/
|
||||||
public function getIndicesForValues(array $values)
|
public function getIndicesForValues(array $values)
|
||||||
{
|
{
|
||||||
|
|
|
@ -198,6 +198,8 @@ class ChoiceList implements ChoiceListInterface
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
*
|
||||||
|
* @deprecated Deprecated since version 2.4, to be removed in 3.0.
|
||||||
*/
|
*/
|
||||||
public function getIndicesForChoices(array $choices)
|
public function getIndicesForChoices(array $choices)
|
||||||
{
|
{
|
||||||
|
@ -222,6 +224,8 @@ class ChoiceList implements ChoiceListInterface
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
*
|
||||||
|
* @deprecated Deprecated since version 2.4, to be removed in 3.0.
|
||||||
*/
|
*/
|
||||||
public function getIndicesForValues(array $values)
|
public function getIndicesForValues(array $values)
|
||||||
{
|
{
|
||||||
|
@ -485,9 +489,9 @@ class ChoiceList implements ChoiceListInterface
|
||||||
* Extension point. In this implementation, choices are guaranteed to
|
* Extension point. In this implementation, choices are guaranteed to
|
||||||
* always maintain their type and thus can be typesafely compared.
|
* always maintain their type and thus can be typesafely compared.
|
||||||
*
|
*
|
||||||
* @param mixed $choice The choice.
|
* @param mixed $choice The choice
|
||||||
*
|
*
|
||||||
* @return mixed The fixed choice.
|
* @return mixed The fixed choice
|
||||||
*/
|
*/
|
||||||
protected function fixChoice($choice)
|
protected function fixChoice($choice)
|
||||||
{
|
{
|
||||||
|
@ -495,14 +499,14 @@ class ChoiceList implements ChoiceListInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fixes the data type of the given choices to avoid comparison problems.
|
* Fixes the data type of the given choices to avoid comparison problems.
|
||||||
*
|
*
|
||||||
* @param array $choices The choices.
|
* @param array $choices The choices.
|
||||||
*
|
*
|
||||||
* @return array The fixed choices.
|
* @return array The fixed choices.
|
||||||
*
|
*
|
||||||
* @see fixChoice
|
* @see fixChoice
|
||||||
*/
|
*/
|
||||||
protected function fixChoices(array $choices)
|
protected function fixChoices(array $choices)
|
||||||
{
|
{
|
||||||
return $choices;
|
return $choices;
|
||||||
|
|
|
@ -138,6 +138,8 @@ interface ChoiceListInterface
|
||||||
* array are ignored
|
* array are ignored
|
||||||
*
|
*
|
||||||
* @return array An array of indices with ascending, 0-based numeric keys
|
* @return array An array of indices with ascending, 0-based numeric keys
|
||||||
|
*
|
||||||
|
* @deprecated Deprecated since version 2.4, to be removed in 3.0.
|
||||||
*/
|
*/
|
||||||
public function getIndicesForChoices(array $choices);
|
public function getIndicesForChoices(array $choices);
|
||||||
|
|
||||||
|
@ -156,6 +158,8 @@ interface ChoiceListInterface
|
||||||
* this array are ignored
|
* this array are ignored
|
||||||
*
|
*
|
||||||
* @return array An array of indices with ascending, 0-based numeric keys
|
* @return array An array of indices with ascending, 0-based numeric keys
|
||||||
|
*
|
||||||
|
* @deprecated Deprecated since version 2.4, to be removed in 3.0.
|
||||||
*/
|
*/
|
||||||
public function getIndicesForValues(array $values);
|
public function getIndicesForValues(array $values);
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,6 +105,8 @@ abstract class LazyChoiceList implements ChoiceListInterface
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
*
|
||||||
|
* @deprecated Deprecated since version 2.4, to be removed in 3.0.
|
||||||
*/
|
*/
|
||||||
public function getIndicesForChoices(array $choices)
|
public function getIndicesForChoices(array $choices)
|
||||||
{
|
{
|
||||||
|
@ -117,6 +119,8 @@ abstract class LazyChoiceList implements ChoiceListInterface
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
*
|
||||||
|
* @deprecated Deprecated since version 2.4, to be removed in 3.0.
|
||||||
*/
|
*/
|
||||||
public function getIndicesForValues(array $values)
|
public function getIndicesForValues(array $values)
|
||||||
{
|
{
|
||||||
|
|
|
@ -135,9 +135,9 @@ class SimpleChoiceList extends ChoiceList
|
||||||
/**
|
/**
|
||||||
* Converts the choice to a valid PHP array key.
|
* Converts the choice to a valid PHP array key.
|
||||||
*
|
*
|
||||||
* @param mixed $choice The choice.
|
* @param mixed $choice The choice
|
||||||
*
|
*
|
||||||
* @return string|integer A valid PHP array key.
|
* @return string|integer A valid PHP array key
|
||||||
*/
|
*/
|
||||||
protected function fixChoice($choice)
|
protected function fixChoice($choice)
|
||||||
{
|
{
|
||||||
|
|
Reference in New Issue