* @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 ProfileChoiceProvider provides employee profile choices. */ final class ProfileChoiceProvider implements FormChoiceProviderInterface { /** * @var array */ private $profiles; /** * @param array $profiles */ public function __construct(array $profiles) { $this->profiles = $profiles; } /** * {@inheritdoc} */ public function getChoices() { $choices = []; foreach ($this->profiles as $profile) { $choices[$profile['name']] = $profile['id_profile']; } return $choices; } }