Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/old/app/code/Cnc/AdminHistory/Model/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/app/code/Cnc/AdminHistory/Model/Customer.php
<?php
/**
 * Copyright (c) 2020 Kaliop Digital Commerce (https://digitalcommerce.kaliop.com) All Rights Reserved.
 * https://opensource.org/licenses/OSL-3.0  Open Software License (OSL 3.0)
 * Cnc
 * Radosław Stępień <[email protected]> <[email protected]>
 */
declare(strict_types=1);

namespace Cnc\AdminHistory\Model;

use Cnc\AdminHistory\Api\Data\CustomerInterface;
use Cnc\AdminHistory\Model\ResourceModel\Customer as CustomerResource;
use Magento\Framework\Api\DataObjectHelper;
use Magento\Framework\Data\Collection\AbstractDb;
use Magento\Framework\Model\AbstractModel;
use Magento\Framework\Model\Context;
use Magento\Framework\Model\ResourceModel\AbstractResource;
use Magento\Framework\Registry;

/**
 * Class Customer
 * Model for history customer
 */
class Customer extends AbstractModel implements CustomerInterface
{
    protected $_eventPrefix = 'cnc_admin_history_product';

    /**
     * @var DataObjectHelper
     */
    protected $dataObjectHelper;

    /**
     * Customer constructor.
     * @param Context $context
     * @param Registry $registry
     * @param DataObjectHelper $dataObjectHelper
     * @param AbstractResource|null $resource
     * @param AbstractDb|null $resourceCollection
     * @param array $data
     */
    public function __construct(
        Context $context,
        Registry $registry,
        DataObjectHelper $dataObjectHelper,
        AbstractResource $resource = null,
        AbstractDb $resourceCollection = null,
        array $data = []
    ) {
        parent::__construct($context, $registry, $resource, $resourceCollection, $data);
        $this->dataObjectHelper = $dataObjectHelper;
    }

    protected function _construct()
    {
        $this->_init(CustomerResource::class);
    }

    /**
     * @return $this
     */
    public function getDataModel(): Customer
    {
        $customerData = $this->getData();
        $this->dataObjectHelper->populateWithArray(
            $this,
            $customerData,
            CustomerInterface::class
        );

        return $this;
    }

    /**
     * @return int|null
     */
    public function getEntityId(): ?int
    {
        return $this->getData(self::ENTITY_ID);
    }

    /**
     * @param int $id
     * @return CustomerInterface
     */
    public function setEntityId($id): CustomerInterface
    {
        return $this->setData(self::ENTITY_ID, $id);
    }

    /**
     * @return int
     */
    public function getCustomerId(): ?int
    {
        return $this->getData(self::CUSTOMER_ID);
    }

    /**
     * @param int $id
     * @return CustomerInterface
     */
    public function setCustomerId($id): CustomerInterface
    {
        return $this->setData(self::CUSTOMER_ID, $id);
    }

    /**
     * @return string|null
     */
    public function getAttributeCode(): ?string
    {
        return $this->getData(self::ATTRIBUTE_CODE);
    }

    /**
     * @param string $attributeCode
     * @return CustomerInterface
     */
    public function setAttributeCode(string $attributeCode): CustomerInterface
    {
        return $this->setData(self::ATTRIBUTE_CODE, $attributeCode);
    }

    /**
     * @return string|null
     */
    public function getOldValue(): ?string
    {
        return $this->getData(self::OLD_VALUE);
    }

    /**
     * @param string $value
     * @return CustomerInterface
     */
    public function setOldValue(string $value): CustomerInterface
    {
        return $this->setData(self::OLD_VALUE, $value);
    }

    /**
     * @return string|null
     */
    public function getNewValue(): ?string
    {
        return $this->getData(self::NEW_VALUE);
    }

    /**
     * @param string $value
     * @return CustomerInterface
     */
    public function setNewValue(string $value): CustomerInterface
    {
        return $this->setData(self::NEW_VALUE, $value);
    }

    /**
     * @return string|null
     */
    public function getUpdatedAt(): ?string
    {
        return $this->getData(self::UPDATED_AT);
    }

    /**
     * @param string $timestamp
     * @return CustomerInterface
     */
    public function setUpdatedAt(string $timestamp): CustomerInterface
    {
        return $this->setData(self::UPDATED_AT, $timestamp);
    }

    /**
     * @return string|null
     */
    public function getUser(): ?string
    {
        return $this->getData(self::USER);
    }

    /**
     * @param string $user
     * @return CustomerInterface
     */
    public function setUser(string $user): CustomerInterface
    {
        return $this->setData(self::USER, $user);
    }
}

Spamworldpro Mini