From: Matthias Schmidt Date: Thu, 15 Apr 2021 13:19:41 +0000 (+0200) Subject: Add `ClipboardHandler::isMarked()` (#4124) X-Git-Tag: 5.4.0_Alpha_1~85 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b6128f977cbec78c575c9ee2fd66799764023251;p=GitHub%2FWoltLab%2FWCF.git Add `ClipboardHandler::isMarked()` (#4124) See WoltLab/com.woltlab.wbb#454 --- diff --git a/wcfsetup/install/files/lib/system/clipboard/ClipboardHandler.class.php b/wcfsetup/install/files/lib/system/clipboard/ClipboardHandler.class.php index 80fb8610d1..fa9f4887cb 100644 --- a/wcfsetup/install/files/lib/system/clipboard/ClipboardHandler.class.php +++ b/wcfsetup/install/files/lib/system/clipboard/ClipboardHandler.class.php @@ -313,6 +313,14 @@ class ClipboardHandler extends SingletonFactory return $this->markedItems; } + /** + * Returns `true` if the object with the given data is marked. + */ + public function isMarked(int $objectTypeID, int $objectID): bool + { + return isset($this->getMarkedItems($objectTypeID)[$objectID]); + } + /** * Returns the data of the items for clipboard editor or `null` if no items are marked. *