Add IReactionObject interface for LikeableObjects
authorJoshua Rüsweg <josh@bastelstu.be>
Fri, 22 Jun 2018 15:46:42 +0000 (17:46 +0200)
committerJoshua Rüsweg <josh@bastelstu.be>
Fri, 22 Jun 2018 15:46:42 +0000 (17:46 +0200)
This interface should help to determine whether the plugin has been adapted to API 3.2. If a LikeableObject does not implement this interface, no notification will be sent.
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..e02baf9
--- /dev/null
@@ -0,0 +1,23 @@
+<?php
+namespace wcf\data\reaction\object;
+use wcf\data\like\Like;
+
+/**
+ * Any reactionable object, which supports notifications, should implement this interface.
+ * 
+ * @TODO backport this for forward compatibility
+ * 
+ * @author     Joshua Ruesweg
+ * @copyright  2001-2018 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package    WoltLabSuite\Core\Data\Reaction\Object
+ * @since       3.2
+ */
+interface IReactionObject {
+       /**
+        * Sends a notification for this reaction.
+        *
+        * @param       Like    $like
+        */
+       public function sendNotification(Like $like);
+}