コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function getValuesForChoices(array $choices)
 {
     if (!$this->loadedList) {
         return $this->loader->loadValuesForChoices($choices, $this->value);
     }
     return $this->loadedList->getValuesForChoices($choices);
 }
コード例 #2
0
ファイル: LazyChoiceList.php プロジェクト: ayoah/symfony
 /**
  * {@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);
 }
コード例 #3
0
 /**
  * {@inheritdoc}
  */
 public function createListFromLoader(ChoiceLoaderInterface $loader, $value = null)
 {
     return $loader->loadChoiceList($value);
 }