Added a admin page for storelocations.

This commit is contained in:
Jan Böhmer 2019-04-28 12:50:35 +02:00
parent 487c78a22b
commit defd169737
7 changed files with 205 additions and 15 deletions

View file

@ -35,8 +35,10 @@ use App\Entity\Device;
use App\Entity\Manufacturer;
use App\Entity\NamedDBElement;
use App\Entity\Part;
use App\Entity\Storelocation;
use App\Entity\Supplier;
use App\Exceptions\EntityNotSupported;
use Symfony\Component\HttpKernel\HttpCache\Store;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
class EntityURLGenerator
@ -133,6 +135,10 @@ class EntityURLGenerator
return $this->urlGenerator->generate("manufacturer_edit", ['id' => $entity->getID()]);
}
if ($entity instanceof Storelocation) {
return $this->urlGenerator->generate("store_location_edit", ['id' => $entity->getID()]);
}
//Otherwise throw an error
throw new EntityNotSupported('The given entity is not supported yet!');
}
@ -170,6 +176,10 @@ class EntityURLGenerator
return $this->urlGenerator->generate('manufacturer_new');
}
if ($entity instanceof Storelocation) {
return $this->urlGenerator->generate('store_location_new');
}
throw new EntityNotSupported('The given entity is not supported yet!');
}
@ -228,6 +238,10 @@ class EntityURLGenerator
return $this->urlGenerator->generate('manufacturer_new', ['id' => $entity->getID()]);
}
if ($entity instanceof Storelocation) {
return $this->urlGenerator->generate('store_location_new', ['id' => $entity->getID()]);
}
throw new EntityNotSupported('The given entity is not supported yet!');
}