/** * Adds Select all choice. * * @param ChoicesAwareViewData $data * @param array $list */ private function addSelectAll(ChoicesAwareViewData $data, $list) { $parameters = $data->getUrlParameters(); $parameters[$this->getRequestField()] = $list; $choice = new Choice(); $choice->setLabel('label.missing_locale.all'); $choice->setUrlParameters($parameters); $data->addChoice($choice); }
/** * Adds prioritized choices. * * @param array $unsortedChoices * @param ChoicesAwareViewData $data * * @return array */ protected function addPriorityChoices(array $unsortedChoices, ChoicesAwareViewData $data) { foreach ($this->getSortType()['priorities'] as $name) { if (array_key_exists($name, $unsortedChoices)) { $data->addChoice($unsortedChoices[$name]); unset($unsortedChoices[$name]); } } return $unsortedChoices; }