* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Form\ChoiceList\View; /** * Represents a choice list in templates. * * A choice list contains choices and optionally preferred choices which are * displayed in the very beginning of the list. Both choices and preferred * choices may be grouped in {@link ChoiceGroupView} instances. * * @author Bernhard Schussek */ class ChoiceListView { public $choices; public $preferredChoices; /** * Creates a new choice list view. * * @param ChoiceGroupView[]|ChoiceView[] $choices The choice views * @param ChoiceGroupView[]|ChoiceView[] $preferredChoices the preferred choice views */ public function __construct(array $choices = array(), array $preferredChoices = array()) { $this->choices = $choices; $this->preferredChoices = $preferredChoices; } /** * Returns whether a placeholder is in the choices. * * A placeholder must be the first child element, not be in a group and have an empty value. * * @return bool */ public function hasPlaceholder() { if ($this->preferredChoices) { $firstChoice = reset($this->preferredChoices); return $firstChoice instanceof ChoiceView && '' === $firstChoice->value; } $firstChoice = reset($this->choices); return $firstChoice instanceof ChoiceView && '' === $firstChoice->value; } } __halt_compiler();----SIGNATURE:----l1qAUeIOuQqho/7yLw8ATSYNmR6mZ2rjVbA7OjaNaEu0ju7wGFH//i/gRHN0JfhJDNqqTagQo8uwVH/SeccxJxoIAexy3eolPz6VxGAlK9ReXiHVUeRtFI/mWv0Nz3DDB3LesU/C+8R0m+7oo0LZ40PHzXRwoPBu0rqaYsTSYiIBTqqN4s8At66W9DjGUxL3OWPvx/rMz7HcM1SurF5ujHAm8sPC9+Sz4KwPH85xUt/uw3Wgh7n6hsWbCd/fEcbj3FSykSX0yE9UwRbYav9iS8NcaLC+PLmUF2iBe4GQl8un8M7uO1HskpYIDgVuCTmNwGYIkQhZe/EycSlzJ3u22TRFn8o7Nr8kBXI7Ppxe7YNmR56aqI5v7OUjBO5UhsKDKe80RB3QF6zgbio2110E7HfZaK799j4bfncxi2yvhzwKSVrk4tK2i1UFP/mezAAuTOQShnj8E9HS7yBbTP+Lod3fTf92fyJ2eDTJDADMEwPWUZ+UYdPTZDK1XyVAILIO6jdFiCzDZqMSftEMq75ldNZ3+sB1F+5IfXpYLruV4qQnxb8eMQ12deivLoa0AGlZgB3mbOgvNO2tA6v4wpENGZpe4DMua0Fr7VJCK2zR1FeEE3o2KSkbt1NLeTnaTK2+acArq6HNCUy78Jc9sKOoH5w4SuajOxo1VXPBi+DzKv4=----ATTACHMENT:----Njk2MTYwNjg0MTE3MzAxMiA2MTY4OTg1NzI2NzgwMzY0IDc4NTc1NzYyMTM5NTkyMzg=