<?php

namespace KupShop\UnitsBundle\AdminRegister;

use KupShop\AdminBundle\AdminRegister\AdminRegister;
use KupShop\AdminBundle\AdminRegister\IAdminRegisterDynamic;
use KupShop\AdminBundle\AdminRegister\IAdminRegisterStatic;

class UnitsAdminRegister extends AdminRegister implements IAdminRegisterDynamic, IAdminRegisterStatic
{
    public function getDynamicMenu(): array
    {
        return [
            static::createMenuItem('productsMenu',
                [
                    'name' => 'productsUnits',
                    'left' => 's=menu.php&type=productsUnits', 'right' => 's=list.php&type=productsUnits',
                    'rights' => 'PRODUCT_',
                ]),
        ];
    }

    public static function getPermissions(): array
    {
        return [
            static::createPermissions('productsUnits', [], ['PRODUCT'], false, [\Modules::PRODUCTS => \Modules::SUB_UNITS]),
        ];
    }
}
