<?php

namespace KupShop\StoresBundle\Admin\Tabs;

use KupShop\AdminBundle\Admin\WindowTab;

class PosStoreSelectTab extends WindowTab
{
    protected $title = 'flapPosStoreSelect';

    protected $template = 'window/posStoreSelectTab.tpl';

    public function handleUpdate()
    {
        if (empty(getVal('data')['data']['stores'] ?? null)) {
            $this->returnError('Není přiřazen sklad k pokladně');
        }
    }

    public function getLabel()
    {
        return translate($this->title, 'posSettings');
    }

    public static function getTypes()
    {
        return [
            'posSettings' => 1,
        ];
    }
}
