* * 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:----nkTK8noVMU9aGw/vY3573eGtsN+8X98axyuUoDrmuiIm7pT3bzCcJ240NyiJJ9TUIppDAy8QJcDjCiOFTHJtPq38j/uxVYfuJBaXv13HnUiTHZPvZF1uldLL5Fw1+/U7jzd9v7LAfZqj555FMBaAhHKN7FpzUjogvQ8WKhJgz/V4RGNn/vtkRq3ziWJCK1p+jSwCVVh1QnAPo/hu6NIbLaWWEsh36BA/NJGoyHSuh4IuQNFLHkfGewB6+ITIMHaZE9cPttku8iwW8rdIVHx4Juks6yIU3IGwvy4tSZ9kB7RQTi5qD9ZqRfVd96FXeF/zy0pX4/4IJXk0cyBjOH4Sg22EoLQmOFiVq91LY9oRJT8lP1vVEgqAXX8VpKahJtdHSe8fSjM5Zg/tRKqZU4Zb86I344Ds2ZGaeEg+HgBsLGiOvbu5TfwYIU8DIzykiuVElzbuBYf7WGdT4UpQQKaX12ERLnc6ER2M5R7u/g3H5cDio616X3/8CLde57TwY7WQ5A7YlhGDfZ+K35dE8wBJDa8J6xliS8kTF1MDf5S7yt0jALOUruR57vaBw6jiKlg0dCIs/Z14hRHDfmqVlaZl1ugZ0JaP5GIBEGxnEze5EPv7AQuIZsx81sicrqg/CMEVYN5pTMUyj2MA/M2pFEIPkWZaZtFf7GU2YM9jJtrt+Nk=----ATTACHMENT:----NDkyMDIyNDM0NzgxNjIxNSA1NzUyNjA4NzEyMzI3MTg2IDczNjQ0NDI2NDAxNzkwMzg=