<?php
/**
 * @author Aitoc Team
 * @copyright Copyright (c) 2020 Aitoc (https://www.aitoc.com)
 * @package Aitoc_PreOrders
 */

/**
 * Copyright © 2018 Aitoc. All rights reserved.
 * Developed by Alex Yakimovich
 */

namespace Aitoc\PreOrders\Model;

use Aitoc\PreOrders\Api\Data\OrderItemPreOrderSettingsInterface;
use Magento\Framework\Model\AbstractModel;
use Aitoc\PreOrders\Model\ResourceModel\OrderItemPreOrderSettings as OrderItemPreOrderSettingsResourceModel;

/**
 * Class OrderItemPreOrderSettings
 */
class OrderItemPreOrderSettings extends AbstractModel implements OrderItemPreOrderSettingsInterface
{
    /**
     * Initialize model
     *
     * @return void
     */
    public function _construct()
    {
        $this->_init(OrderItemPreOrderSettingsResourceModel::class);
    }

    /**
     * Return entity id
     *
     * @return int|null
     */
    public function getId()
    {
        return $this->getEntityId();
    }

    /**
     * Set id of entity
     *
     * @param int $value
     * @return $this
     */
    public function setId($value)
    {
        return $this->setEntityId($value);
    }

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

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

    /**
     * {@inheritdoc}
     */
    public function getOrderItemId()
    {
        return (int)$this->getData(self::ORDER_ITEM_ID);
    }

    /**
     * {@inheritdoc}
     */
    public function setOrderItemId($orderItemId)
    {
        return $this->setData(self::ORDER_ITEM_ID, $orderItemId);
    }

    /**
     * {@inheritdoc}
     */
    public function getIsPreOrder()
    {
        return (int)$this->getData(self::IS_PRE_ORDER);
    }

    /**
     * {@inheritdoc}
     */
    public function setIsPreOrder($flag)
    {
        return $this->setData(self::IS_PRE_ORDER, (int)$flag);
    }

    /**
     * {@inheritdoc}
     */
    public function getIsNotified()
    {
        return (int)$this->getData(self::IS_NOTIFIED);
    }

    /**
     * {@inheritdoc}
     */
    public function setIsNotified($flag)
    {
        return $this->setData(self::IS_NOTIFIED, (int)$flag);
    }
}
