aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Notification
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-10-07 17:00:24 +0200
committerJoas Schilling <coding@schilljs.com>2016-10-07 17:00:24 +0200
commitc77933ca22bb7614f546bacbb62f22e2fa3074f5 (patch)
tree8af119a8b2c50c231e43f92b7b838bc0afa81efc /lib/private/Notification
parent7264d20152df326b82f5daebf26ee8e5161cb359 (diff)
downloadnextcloud-server-c77933ca22bb7614f546bacbb62f22e2fa3074f5.tar.gz
nextcloud-server-c77933ca22bb7614f546bacbb62f22e2fa3074f5.zip
Add an icon to the notification API
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/Notification')
-rw-r--r--lib/private/Notification/Notification.php32
1 files changed, 27 insertions, 5 deletions
diff --git a/lib/private/Notification/Notification.php b/lib/private/Notification/Notification.php
index 9b5877a3058..7bf4b9a74cf 100644
--- a/lib/private/Notification/Notification.php
+++ b/lib/private/Notification/Notification.php
@@ -242,7 +242,7 @@ class Notification implements INotification {
/**
* @param string $subject
* @return $this
- * @throws \InvalidArgumentException if the subject are invalid
+ * @throws \InvalidArgumentException if the subject is invalid
* @since 8.2.0
*/
public function setParsedSubject($subject) {
@@ -300,7 +300,7 @@ class Notification implements INotification {
/**
* @param string $message
* @return $this
- * @throws \InvalidArgumentException if the message are invalid
+ * @throws \InvalidArgumentException if the message is invalid
* @since 8.2.0
*/
public function setParsedMessage($message) {
@@ -322,7 +322,7 @@ class Notification implements INotification {
/**
* @param string $link
* @return $this
- * @throws \InvalidArgumentException if the link are invalid
+ * @throws \InvalidArgumentException if the link is invalid
* @since 8.2.0
*/
public function setLink($link) {
@@ -342,6 +342,28 @@ class Notification implements INotification {
}
/**
+ * @param string $icon
+ * @return $this
+ * @throws \InvalidArgumentException if the icon is invalid
+ * @since 9.2.0
+ */
+ public function setIcon($icon) {
+ if (!is_string($icon) || $icon === '' || isset($icon[4000])) {
+ throw new \InvalidArgumentException('The given icon is invalid');
+ }
+ $this->icon = $icon;
+ return $this;
+ }
+
+ /**
+ * @return string
+ * @since 9.2.0
+ */
+ public function getIcon() {
+ return $this->icon;
+ }
+
+ /**
* @return IAction
* @since 8.2.0
*/
@@ -352,7 +374,7 @@ class Notification implements INotification {
/**
* @param IAction $action
* @return $this
- * @throws \InvalidArgumentException if the action are invalid
+ * @throws \InvalidArgumentException if the action is invalid
* @since 8.2.0
*/
public function addAction(IAction $action) {
@@ -383,7 +405,7 @@ class Notification implements INotification {
/**
* @param IAction $action
* @return $this
- * @throws \InvalidArgumentException if the action are invalid
+ * @throws \InvalidArgumentException if the action is invalid
* @since 8.2.0
*/
public function addParsedAction(IAction $action) {