<?php

class ProductsMenu extends Menu
{
    use \KupShop\AdminBundle\Util\CategoryTree;

    public function get_vars()
    {
        $vars = parent::get_vars();

        $SQL = sqlQuery('SELECT pr.id, pr.name
					FROM '.getTableName('producers').' AS pr
					ORDER BY pr.name ASC');

        $producers = [];
        foreach ($SQL as $row) {
            $producers[] = $row;
        }

        $vars['sections'] = $this->getCategories();
        $vars['producers'] = $producers;

        return $vars;
    }
}
