/**
  * Creates a new choice loader.
  *
  * @param EntityLoaderInterface             $objectLoader The objects loader
  * @param IdReader                          $idReader     The reader for the object
  *                                                        IDs.
  * @param null|callable|string|PropertyPath $label        The callable or path generating the choice labels
  * @param ChoiceListFactoryInterface|null   $factory      The factory for creating
  *                                                        the loaded choice list
  */
 public function __construct(EntityLoaderInterface $objectLoader, IdReader $idReader, $label, $factory = null)
 {
     parent::__construct($factory);
     $this->objectLoader = $objectLoader;
     $this->idReader = $idReader;
     $this->label = $label;
 }
 /**
  * Creates a new choice loader.
  *
  * @param array                           $choices The choices
  * @param ChoiceListFactoryInterface|null $factory The factory for creating
  *                                                 the loaded choice list
  */
 public function __construct(array $choices, $factory = null)
 {
     parent::__construct($factory);
     $this->allChoices = true;
     $this->choices = $choices;
 }