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/SerialNumber/Model/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/app/code/Cnc/SerialNumber/Model/SerialNumber.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)
 * Krzysztof Majkowski <[email protected]>
 */

declare(strict_types=1);

namespace Cnc\SerialNumber\Model;

use Cnc\SerialNumber\Api\Data\SerialNumberExtensionInterface;
use Cnc\SerialNumber\Api\Data\SerialNumberInterface;
use Cnc\SerialNumber\Model\ResourceModel\SerialNumber as ResourceModel;
use Magento\Framework\DataObject\IdentityInterface;
use Magento\Framework\Model\AbstractExtensibleModel;

class SerialNumber extends AbstractExtensibleModel implements SerialNumberInterface, IdentityInterface
{
    const CACHE_TAG = 'serial_number_model';

    const STATUS_LABELS = [
        0 => 'Blocked',
        1 => 'Available',
        2 => 'Reserved',
        3 => 'Sold',
        4 => 'Canceled',
    ];

    /**
     * @var string
     */
    protected $_eventPrefix = 'cnc_serial_number_model';

    /**
     * @inheritdoc
     */
    protected function _construct()
    {
        $this->_init(ResourceModel::class);
    }

    /**
     * {@inheritDoc}
     */
    public function getSerialNumber(): ?string
    {
        return $this->getData(self::SERIAL_NUMBER);
    }

    /**
     * {@inheritDoc}
     */
    public function getSourceCode(): ?string
    {
        return $this->getData(self::SOURCE_CODE);
    }

    /**
     * {@inheritDoc}
     */
    public function getSku(): ?string
    {
        return $this->getData(self::SKU);
    }

    /**
     * {@inheritDoc}
     */
    public function getOrigin(): ?string
    {
        return $this->getData(self::ORIGIN);
    }

    /**
     * {@inheritDoc}
     */
    public function getCreatedAt(): ?string
    {
        return $this->getData(self::CREATED_AT);
    }

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

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

    /**
     * {@inheritDoc}
     */
    public function getStatusLabel(): ?string
    {
        $statusId = $this->getData(self::STATUS);
        return self::STATUS_LABELS[$statusId];
    }

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

    /**
     * {@inheritDoc}
     */
    public function getOrderIncrementId(): ?string
    {
        return $this->getData(self::ORDER_INCREMENT_ID);
    }

    /**
     * {@inheritDoc}
     */
    public function getOrderCreatedAt(): ?string
    {
        return $this->getData(self::ORDER_CREATED_AT);
    }

    /**
     * {@inheritDoc}
     */
    public function setSerialNumber(string $serialNumber): SerialNumberInterface
    {
        return $this->setData(self::SERIAL_NUMBER, $serialNumber);
    }

    /**
     * {@inheritDoc}
     */
    public function setSourceCode(string $sourceCode): SerialNumberInterface
    {
        return $this->setData(self::SOURCE_CODE, $sourceCode);
    }

    /**
     * {@inheritDoc}
     */
    public function setSku(string $sku): SerialNumberInterface
    {
        return $this->setData(self::SKU, $sku);
    }

    /**
     * {@inheritDoc}
     */
    public function setOrigin(string $origin): SerialNumberInterface
    {
        return $this->setData(self::ORIGIN, $origin);
    }

    /**
     * {@inheritDoc}
     */
    public function setCreatedAt(string $createdAt): SerialNumberInterface
    {
        return $this->setData(self::CREATED_AT, $createdAt);
    }

    /**
     * {@inheritDoc}
     */
    public function setAdminUserId(int $adminUserId): SerialNumberInterface
    {
        return $this->setData(self::ADMIN_USER_ID, $adminUserId);
    }

    /**
     * {@inheritDoc}
     */
    public function setStatus(int $status): SerialNumberInterface
    {
        return $this->setData(self::STATUS, $status);
    }

    /**
     * {@inheritDoc}
     */
    public function setIsExported(int $isExported): SerialNumberInterface
    {
        return $this->setData(self::IS_EXPORTED, $isExported);
    }

    /**
     * @param string $orderIncrementId
     * @return SerialNumberInterface
     */
    public function setOrderIncrementId(string $orderIncrementId): SerialNumberInterface
    {
        return $this->setData(self::ORDER_INCREMENT_ID, $orderIncrementId);
    }

    /**
     * @param string $orderCreatedAt
     * @return SerialNumberInterface
     */
    public function setOrderCreatedAt(string $orderCreatedAt): SerialNumberInterface
    {
        return $this->setData(self::ORDER_CREATED_AT, $orderCreatedAt);
    }

    /**
     * {@inheritDoc}
     */
    public function getIdentities(): array
    {
        return [self::CACHE_TAG . '_' . $this->getId()];
    }

    /**
     * @inheritdoc
     */
    public function getExtensionAttributes(): ?SerialNumberExtensionInterface
    {
        $extensionAttributes = $this->_getExtensionAttributes();
        if (null === $extensionAttributes) {
            $extensionAttributes = $this->extensionAttributesFactory->create(SerialNumberInterface::class);
            $this->setExtensionAttributes($extensionAttributes);
        }
        return $extensionAttributes;
    }

    /**
     * @inheritdoc
     */
    public function setExtensionAttributes(SerialNumberExtensionInterface $extensionAttributes): void
    {
        $this->_setExtensionAttributes($extensionAttributes);
    }
}

Spamworldpro Mini