<?php
/**
 * Quotes Model
 *
 * @category  Magetop Extensions
 * @package   Magetop_Quotesystem
 * @author    Magetop Developer
 * @copyright Copyright (c) Magetop (https://www.magetop.com)
 * @license   https://www.magetop.com/license.html
 */

namespace Magetop\Quotesystem\Model;

use Magetop\Quotesystem\Api\Data\QuoteInterface;
use Magento\Framework\DataObject\IdentityInterface;
use Magento\Framework\Model\AbstractModel;

class Quotes extends AbstractModel implements QuoteInterface, IdentityInterface
{
    public const CACHE_TAG = 'quotesystem_quotes';
    public const STATUS_UNAPPROVED = 1;
    public const STATUS_APPROVED = 2;
    public const STATUS_DECLINE = 3;
    public const STATUS_SOLD = 4;

    /**
     * @var string
     */
    protected $_cacheTag = 'quotesystem_quotes';

    /**
     * Prefix of model events names
     *
     * @var string
     */
    protected $_eventPrefix = 'quotesystem_quotes';

    /**
     * Initialize resource model
     *
     * @return void
     */
    protected function _construct()
    {
        $this->_init(\Magetop\Quotesystem\Model\ResourceModel\Quotes ::class);
    }
    /**
     * Return unique ID(s) for each object in system
     *
     * @return array
     */
    public function getIdentities()
    {
        return [self::CACHE_TAG . '_' . $this->getEntityId()];
    }

    /**
     * Get ID
     *
     * @return int|null
     */
    public function getEntityId()
    {
        return $this->getData(self::ENTITYID);
    }
    /**
     * Set ID
     *
     * @param int $entityId
     * @return \Magetop\Quotesystem\Model\Quotes
     */
    public function setEntityId($entityId)
    {
        return $this->setData(self::ENTITYID, $entityId);
    }

    /**
     * Get attachments
     *
     * @return string|null
     */
    public function getAttachments()
    {
        return $this->getData(self::ATTACHMENTS);
    }
    
    /**
     * Set attachments
     *
     * @param string $attachments
     *
     * @return \Magetop\Quotesystem\Api\Data\QuoteInterface
     */
    public function setAttachments($attachments)
    {
        return $this->setData(self::ATTACHMENTS, $attachments);
    }
}
