51 lines
1.1 KiB
PHP
51 lines
1.1 KiB
PHP
<?php
|
||
/**
|
||
* @package Plumrocket_CookieConsentPro
|
||
* @copyright Copyright (c) 2025 Plumrocket Inc.
|
||
* @license https://plumrocket.com/license End-user License Agreement
|
||
*/
|
||
|
||
declare(strict_types=1);
|
||
|
||
namespace Plumrocket\CookieConsentPro\Model\Consent;
|
||
|
||
use Magento\Framework\Model\AbstractModel;
|
||
use Plumrocket\CookieConsentPro\Api\Data\ConsentLogInterface;
|
||
|
||
/**
|
||
* @since 1.0.1
|
||
*/
|
||
class Log extends \Plumrocket\CookieConsent\Model\Consent\Log implements ConsentLogInterface
|
||
{
|
||
/**
|
||
* @inheritDoc
|
||
*/
|
||
public function getInitiatedBy()
|
||
{
|
||
return $this->getData(self::INITIATED_BY);
|
||
}
|
||
|
||
/**
|
||
* @inheritDoc
|
||
*/
|
||
public function setInitiatedBy(string $initiatedBy)
|
||
{
|
||
$this->setData(self::INITIATED_BY, $initiatedBy);
|
||
return $this;
|
||
}
|
||
|
||
/**
|
||
* @return AbstractModel
|
||
*/
|
||
public function beforeSave()
|
||
{
|
||
$initiatedBy = $this->getInitiatedBy();
|
||
|
||
if (empty($initiatedBy)) {
|
||
$this->setInitiatedBy('Сustomer');
|
||
}
|
||
|
||
return parent::beforeSave();
|
||
}
|
||
}
|