treeGenerator = $treeGenerator; } /** * @Route("/tools", name="tree_tools") */ public function tools(ToolsTreeBuilder $builder) { $tree = $builder->getTree(); return new JsonResponse($tree); } /** * @Route("/category/{id}", name="tree_category") * @Route("/categories") */ public function categoryTree(Category $category = null) { $tree = $this->treeGenerator->getTreeView(Category::class, $category); return new JsonResponse($tree); } /** * @Route("/footprint/{id}", name="tree_footprint") * @Route("/footprints") */ public function footprintTree(Footprint $footprint = null) { $tree = $this->treeGenerator->getTreeView(Footprint::class, $footprint); return new JsonResponse($tree); } /** * @Route("/location/{id}", name="tree_location") * @Route("/locations") */ public function locationTree(Storelocation $location = null) { $tree = $this->treeGenerator->getTreeView(Storelocation::class, $location); return new JsonResponse($tree); } /** * @Route("/manufacturer/{id}", name="tree_manufacturer") * @Route("/manufacturers") */ public function manufacturerTree(Manufacturer $manufacturer = null) { $tree = $this->treeGenerator->getTreeView(Manufacturer::class, $manufacturer); return new JsonResponse($tree); } /** * @Route("/supplier/{id}", name="tree_supplier") * @Route("/suppliers") */ public function supplierTree(Supplier $supplier = null) { $tree = $this->treeGenerator->getTreeView(Supplier::class, $supplier); return new JsonResponse($tree); } /** * @Route("/device/{id}", name="tree_device") * @Route("/devices") */ public function deviceTree(Device $device = null) { $tree = $this->treeGenerator->getTreeView(Device::class, $device, ''); return new JsonResponse($tree); } }