Show a treeview in the admin menus, to select between the different elements.

This commit is contained in:
Jan Böhmer 2019-04-05 17:49:02 +02:00
parent 928b574d8c
commit 650b388a1d
16 changed files with 269 additions and 25 deletions

View file

@ -29,6 +29,7 @@
namespace App\Services;
use App\Entity\AttachmentType;
use App\Entity\Category;
use App\Entity\NamedDBElement;
use App\Entity\Part;
@ -107,6 +108,10 @@ class EntityURLGenerator
return $this->urlGenerator->generate('part_edit', ['id' => $entity->getID()]);
}
if($entity instanceof AttachmentType) {
return $this->urlGenerator->generate('attachment_type_edit', ['id' => $entity->getID()]);
}
//Otherwise throw an error
throw new EntityNotSupported('The given entity is not supported yet!');
}
@ -124,6 +129,10 @@ class EntityURLGenerator
return $this->urlGenerator->generate('part_new');
}
if($entity instanceof AttachmentType) {
return $this->urlGenerator->generate('attachment_type_new');
}
throw new EntityNotSupported('The given entity is not supported yet!');
}