Added possibillity to delete attachments in admin page.

This commit is contained in:
Jan Böhmer 2019-04-06 18:38:36 +02:00
parent 72cd9a3722
commit 7c43feefbe
10 changed files with 133 additions and 19 deletions

View file

@ -73,6 +73,8 @@ class EntityURLGenerator
case 'list':
case 'list_parts':
return $this->listPartsURL($entity);
case 'delete':
return $this->deleteURL($entity);
}
throw new \InvalidArgumentException('Method is not supported!');
@ -169,6 +171,15 @@ class EntityURLGenerator
}
public function deleteURL($entity) : string
{
if($entity instanceof AttachmentType) {
return $this->urlGenerator->generate('attachment_type_delete', ['id' => $entity->getID()]);
}
throw new EntityNotSupported('The given entity is not supported yet!');
}
/**
* Generates an HTML link to the info page about the given entity.
*