* * 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:----udjfq7td9aOahWL7yyYnbjH7ErBBZXhvybxMKYaCwjBDEPK0eRf50Lk0kXtF6BEnHrfJcspfUv00m/Qfu6q1Zkj8BkjCc2tokLjIYBXFIuBZqVbUlG62HnwBMGJrZMuG91+IzST3XE+0Ct7mbuj4LGUjGciZD2Ewxvwg4LETXCHVTBf6bkHWvQF0JHZbdY7s9zt1b8Nyu4YHAfLDqmwldU9pO4dpkhkcfID2bRNqFj26WC7bRYbb8xKnGJTzvUFEHBm8dvuNwuyz5s3wyUSs/JsFKEhDhA9M6fNHuKNaALMUYr7xfVYn4D2kDQhAfn5I3Z/NRKKMSHR5PXT+Y/zONLH1RNg/IdUIv1prEiEkrLy9xPfyXPtfBDBXOndZRB4d6xi8mcXAp1jm9UBFR+htAl8ziMw77ctOoWemvQ+/GjxhIobuB8qkBA+p/MFd+x1MNfhewD4s5Sqo1HYNzjqz8pTC2HdLRxOWF5Tlb8G1w6mLV+ZkQvq71J6/mXyE7DAvdqQ/0UeHdyqpaCKsflh2v24f9h1uf0ynOQwB+zc7rCY0IHfPkFHqjzLZgRVsTIDL9BFIZn95BW8mexOEtgS/HAq/nMkUhXxIl89BBURcELO4vgKUIlo7tRbJ5wdMD0fUEalLLHUgVo5S+1rWGNtt7Uys88pq04MldOL/i+HGZGc=----ATTACHMENT:----NzMxODQxNzA3NDcxOTIwNyA2NjE2MzM0MTU5NTUzNDQ4IDY1OTY5ODIxMzYzNzg2OTc=