* @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ namespace PrestaShopBundle\Form\Admin\Configure\AdvancedParameters\Administration; use PrestaShop\PrestaShop\Core\Configuration\DataConfigurationInterface; use PrestaShop\PrestaShop\Core\Form\FormDataProviderInterface; /** * This class is responsible of managing the data manipulated using forms * in "Configure > Advanced Parameters > Administration" page. */ final class FormDataProvider implements FormDataProviderInterface { public const ERROR_NOT_NUMERIC_OR_LOWER_THAN_ZERO = 1; public const ERROR_COOKIE_LIFETIME_MAX_VALUE_EXCEEDED = 2; public const ERROR_COOKIE_SAMESITE_NONE = 3; /** * @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); } }