* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Form\ChoiceList\Factory; use Symfony\Component\Form\ChoiceList\ChoiceListInterface; use Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface; use Symfony\Component\Form\ChoiceList\View\ChoiceListView; /** * Creates {@link ChoiceListInterface} instances. * * @author Bernhard Schussek */ interface ChoiceListFactoryInterface { /** * Creates a choice list for the given choices. * * The choices should be passed in the values of the choices array. * * Optionally, a callable can be passed for generating the choice values. * The callable receives the choice as first and the array key as the second * argument. * * @param iterable $choices The choices * @param null|callable $value The callable generating the choice * values * * @return ChoiceListInterface The choice list */ public function createListFromChoices($choices, $value = null); /** * Creates a choice list that is loaded with the given loader. * * Optionally, a callable can be passed for generating the choice values. * The callable receives the choice as first and the array key as the second * argument. * * @param ChoiceLoaderInterface $loader The choice loader * @param null|callable $value The callable generating the choice * values * * @return ChoiceListInterface The choice list */ public function createListFromLoader(ChoiceLoaderInterface $loader, $value = null); /** * Creates a view for the given choice list. * * Callables may be passed for all optional arguments. The callables receive * the choice as first and the array key as the second argument. * * * The callable for the label and the name should return the generated * label/choice name. * * The callable for the preferred choices should return true or false, * depending on whether the choice should be preferred or not. * * The callable for the grouping should return the group name or null if * a choice should not be grouped. * * The callable for the attributes should return an array of HTML * attributes that will be inserted in the tag of the choice. * * If no callable is passed, the labels will be generated from the choice * keys. The view indices will be generated using an incrementing integer * by default. * * The preferred choices can also be passed as array. Each choice that is * contained in that array will be marked as preferred. * * The attributes can be passed as multi-dimensional array. The keys should * match the keys of the choices. The values should be arrays of HTML * attributes that should be added to the respective choice. * * @param ChoiceListInterface $list The choice list * @param null|array|callable $preferredChoices The preferred choices * @param null|callable $label The callable generating the * choice labels * @param null|callable $index The callable generating the * view indices * @param null|callable $groupBy The callable generating the * group names * @param null|array|callable $attr The callable generating the * HTML attributes * * @return ChoiceListView The choice list view */ public function createView(ChoiceListInterface $list, $preferredChoices = null, $label = null, $index = null, $groupBy = null, $attr = null); } __halt_compiler();----SIGNATURE:----KZtEy4lunp95qsBR9zT8eHmDu8UfBVt3M56Ga+D/WI9GE9wDS7mSuLVWwkhlRbhXMULVcBxc+cDtUDHx3Iz0Jm6aOwjMoSdbN+qjz0lwppjcP5gqmkXDhlTKdfikpViO3tbjg25o168e0Gw/8raz1GsLKB4qV93JoknNvQKKeRwslhzuu4AWI0dw09IzpLYodW1RlYJnEt902Ih4fk6pfZ2Z22evQTUoNo88oICk95TM6lZy4oYl2AmO90WlReYUbw0pmln0kBCXlFXqiYwUOgNNOOpznGl9otwnSJdTI1B3LWH9/bSSJbp6AFOb0xhybv+qH3Ol+rTeCPIDww6W8DR/wwGMYTYU5xCkY5v6eBoM1FDye7k7OyuMb/RL6UXckMQ4XWOtjD3m4L/jjB/owrIaMk0KzVJueAILmDwgYKPuRhL8Yf31ACBJXw1mA12utbZzKOqLjfA4iikRxf/g+lupK0ModUhqn8x7ow0oPxzw3kD3AT4po1D8DDEbyieX3HIQvQ7qxp6XZWb0SQVHOiPzMVK+25rmo9lXoe/iVXeVTiihjtvHLDi9zgcasiw5kZs9W9GBPNWOoLpA03+EcfuSNV5jOm1iVVD9vBN0ZBxvc06gDn75bNLE3ylpIR1uXCoRN7W52rJRQeOzsxb8UdkSYEbbu3vSjcdm0e+P0rE=----ATTACHMENT:----MjUwMDYwNjU2NjY2MDAgNzA0ODEzNzQ1NTczOTAyMSA3MjMxMDA2MDk4NDUzMTc2