Backport IReactionObject to version 3.0
authorJoshua Rüsweg <ruesweg@woltlab.com>
Wed, 15 May 2019 15:00:44 +0000 (17:00 +0200)
committerJoshua Rüsweg <ruesweg@woltlab.com>
Wed, 15 May 2019 15:00:44 +0000 (17:00 +0200)
This backport ensures the compatibility for version 3.0 (and above) and version 5.2. With this commit, plugins can fully support the reaction system and the like system, previously this was only possible to a limited extent.
See #2508

wcfsetup/install/files/lib/data/reaction/object/IReactionObject.class.php [new file with mode: 0644]

diff --git a/wcfsetup/install/files/lib/data/reaction/object/IReactionObject.class.php b/wcfsetup/install/files/lib/data/reaction/object/IReactionObject.class.php
new file mode 100644 (file)
index 0000000..32c48e5
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+namespace wcf\data\reaction\object;
+use wcf\data\like\Like;
+
+/**
+ * Any reactionable object, which supports notifications, should implement this interface.
+ *
+ * @author     Joshua Ruesweg
+ * @copyright  2001-2019 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package    WoltLabSuite\Core\Data\Reaction\Object
+ * @since       3.0
+ */
+interface IReactionObject {
+       /**
+        * Sends a notification for this reaction.
+        *
+        * @param       Like    $like
+        */
+       public function sendNotification(Like $like);
+}