* @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ namespace PrestaShop\PrestaShop\Core\Form\ChoiceProvider; use PrestaShop\PrestaShop\Core\Form\FormChoiceProviderInterface; /** * Class ImportMatchConfigurationChoiceProvider is responsible for providing choices * in Advanced parameters -> Import -> Step 2 -> Load a data matching configuration. */ final class ImportMatchConfigurationChoiceProvider implements FormChoiceProviderInterface { /** * @var array */ private $matchConfigurations; /** * @param array $matchConfigurations */ public function __construct(array $matchConfigurations) { $this->matchConfigurations = $matchConfigurations; } /** * {@inheritdoc} */ public function getChoices() { $choices = []; foreach ($this->matchConfigurations as $configuration) { $choices[$configuration['name']] = $configuration['id_import_match']; } return $choices; } }