consentLogResource = $consentLogResource; $this->isGpcSignalHandled = $isGpcSignalHandled; } /** * @param array $settings * @return \Plumrocket\CookieConsent\Api\Data\ConsentLogInterface * @throws \Magento\Framework\Exception\AlreadyExistsException * @throws \Magento\Framework\Exception\NoSuchEntityException */ public function log(array $settings): ConsentLogInterface { $consentLog = parent::log($settings); if ($this->isGpcSignalHandled->execute()) { $consentLog->setData(ProConsentLogInterface::INITIATED_BY, ConsentInitiator::INITIATOR_GPC); $this->consentLogResource->save($consentLog); } return $consentLog; } }