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