From f8acffcfb1ea7cc82af1de185661ef48dc3f89dd Mon Sep 17 00:00:00 2001 From: Marco Perberschlager Date: Wed, 8 May 2024 15:48:54 +0200 Subject: [PATCH] Added `isPublished` method --- src/Models/Element/ServiceResolver.php | 5 +++++ src/Models/Element/ServiceResolverInterface.php | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/Models/Element/ServiceResolver.php b/src/Models/Element/ServiceResolver.php index 9fc8b17..99ccdca 100644 --- a/src/Models/Element/ServiceResolver.php +++ b/src/Models/Element/ServiceResolver.php @@ -44,4 +44,9 @@ public function findForbiddenPaths(string $type, User $user): array { return Service::findForbiddenPaths($type, $user); } + + public function isPublished(ElementInterface $element = null): bool + { + return Service::isPublished($element); + } } diff --git a/src/Models/Element/ServiceResolverInterface.php b/src/Models/Element/ServiceResolverInterface.php index 0fb434c..78199ab 100644 --- a/src/Models/Element/ServiceResolverInterface.php +++ b/src/Models/Element/ServiceResolverInterface.php @@ -39,4 +39,6 @@ public function getElementByPath( public function getElementType(ElementInterface $element): ?string; public function findForbiddenPaths(string $type, User $user): array; + + public function isPublished(ElementInterface $element = null): bool; }