Allow to show parts for manufacturers and footprints.

This commit is contained in:
Jan Böhmer 2019-09-08 13:59:35 +02:00
parent 8dc9c7b9ae
commit c3fd325645
10 changed files with 126 additions and 46 deletions

View file

@ -277,8 +277,17 @@ class EntityURLGenerator
public function listPartsURL($entity) : string
{
if ($entity instanceof Category) {
return $this->urlGenerator->generate('app_partlists_showcategory', ['id' => $entity->getID()]);
return $this->urlGenerator->generate('part_list_category', ['id' => $entity->getID()]);
}
if ($entity instanceof Footprint) {
return $this->urlGenerator->generate('part_list_footprint', ['id' => $entity->getID()]);
}
if ($entity instanceof Manufacturer) {
return $this->urlGenerator->generate('part_list_manufacturer', ['id' => $entity->getID()]);
}
throw new EntityNotSupported('The given entity is not supported yet!');
}