<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-present http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace app\admin\model;

use app\admin\service\NavMenuService;
use think\Model;

class NavMenuModel extends Model
{
    /**
     * 模型名称
     * @var string
     */
    protected $name = 'nav_menu';

    /**
     * 获取某导航下所有菜单树形结构数组
     * @param int $navId    导航id
     * @param int $maxLevel 最大获取层级,默认不限制
     * @return array
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     * @deprecated
     */
    public function navMenusTreeArray($navId = 0, $maxLevel = 0)
    {
        return NavMenuService::navMenusTreeArray($navId, $maxLevel);
    }

    /**
     * 获取某导航菜单下的所有子菜单树形结构数组
     * @param int $menuId 导航菜单id
     * @return array
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     * @deprecated
     */
    public function subNavMenusTreeArray($menuId)
    {
        return NavMenuService::subNavMenusTreeArray($menuId);
    }

    /**
     * 获取共享nav模板结构
     * @return array
     * @deprecated
     */
    public function selectNavs()
    {
        return NavMenuService::selectNavs();
    }

}
