/** * {@inheritdoc} */ public function getValues() { if (!$this->loadedList) { $this->loadedList = $this->loader->loadChoiceList($this->value); } return $this->loadedList->getValues(); }
/** * {@inheritdoc} */ public function getValuesForChoices(array $choices) { if ($this->loaded) { // Check whether the loader has the same cache if ($this->loadedList !== $this->loader->loadChoiceList($this->value)) { @trigger_error(sprintf('Caching the choice list in %s is deprecated since 3.1 and will not happen in 4.0. Cache the list in the %s instead.', __CLASS__, ChoiceLoaderInterface::class), E_USER_DEPRECATED); } return $this->loadedList->getValuesForChoices($choices); } return $this->loader->loadValuesForChoices($choices, $this->value); }
/** * {@inheritdoc} */ public function createListFromLoader(ChoiceLoaderInterface $loader, $value = null) { return $loader->loadChoiceList($value); }