From ea8b179df1e6358cb241c0f025da3f8da833c914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Tue, 6 Jun 2023 23:16:51 +0200 Subject: [PATCH] Added timetravel URL for PartAttachment elements --- src/Services/EntityURLGenerator.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Services/EntityURLGenerator.php b/src/Services/EntityURLGenerator.php index 09295034..5f45e58c 100644 --- a/src/Services/EntityURLGenerator.php +++ b/src/Services/EntityURLGenerator.php @@ -26,6 +26,7 @@ use App\Entity\Attachments\Attachment; use App\Entity\Attachments\AttachmentType; use App\Entity\Attachments\PartAttachment; use App\Entity\Base\AbstractDBElement; +use App\Entity\Parameters\PartParameter; use App\Entity\ProjectSystem\Project; use App\Entity\LabelSystem\LabelProfile; use App\Entity\Parts\Category; @@ -158,6 +159,12 @@ class EntityURLGenerator 'timestamp' => $dateTime->getTimestamp(), ]); } + if ($entity instanceof PartParameter) { + return $this->urlGenerator->generate('part_info', [ + 'id' => $entity->getElement()->getID(), + 'timestamp' => $dateTime->getTimestamp(), + ]); + } } //Otherwise throw an error