* @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ declare(strict_types=1); namespace PrestaShopBundle\Form\Admin\Improve\Shipping\Preferences; use PrestaShop\PrestaShop\Core\Configuration\DataConfigurationInterface; use PrestaShop\PrestaShop\Core\Form\FormDataProviderInterface; /** * Class is responsible of managing the data manipulated using forms * in "Improve > Shipping > Preferences" page. */ class PreferencesHandlingFormDataProvider implements FormDataProviderInterface { /** * @var DataConfigurationInterface */ private $dataConfiguration; public function __construct(DataConfigurationInterface $dataConfiguration) { $this->dataConfiguration = $dataConfiguration; } /** * {@inheritdoc} */ public function getData() { return $this->dataConfiguration->getConfiguration(); } /** * {@inheritdoc} */ public function setData(array $data) { return $this->dataConfiguration->updateConfiguration($data); } }