Add `ClipboardHandler::isMarked()` (#4124)
authorMatthias Schmidt <gravatronics@live.com>
Thu, 15 Apr 2021 13:19:41 +0000 (15:19 +0200)
committerGitHub <noreply@github.com>
Thu, 15 Apr 2021 13:19:41 +0000 (15:19 +0200)
See WoltLab/com.woltlab.wbb#454

wcfsetup/install/files/lib/system/clipboard/ClipboardHandler.class.php

index 80fb8610d17aaf71be9223d06237ead5588810be..fa9f4887cb7e68f8365ff2a68309fd8603e2b0a7 100644 (file)
@@ -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.
      *