<?php

namespace KupShop\CatalogBundle\Resources\upgrade;

class StockInUpgrade extends \UpgradeNew
{
    public function check_StockInAddPreOrderIndex()
    {
        return findModule(\Modules::STOCK_IN) && $this->checkEnumOptions('stock_in', 'id_index', ['invoice', 'closure', 'future', 'preorder']);
    }

    /** Stock_in: add 'preorder' value to id_index enum  */
    public function upgrade_StockInAddPreOrderIndex()
    {
        $this->updateEnumOptions('stock_in', 'id_index', ['invoice', 'closure', 'future', 'preorder'], 'invoice');

        $this->upgradeOK();
    }
}
