summaryrefslogtreecommitdiffstats
path: root/lib/private/notification
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-09-01 10:46:08 +0200
committerJoas Schilling <nickvergessen@owncloud.com>2015-09-08 09:01:01 +0200
commit3bdfef910708eaba19daaf7d1d992cd4575af3b4 (patch)
tree895c842023ea379a0b7caeaa212bf82fb924d3b1 /lib/private/notification
parentf0ecfa6e6c49253230fa847ff2ce7082f6c97e68 (diff)
downloadnextcloud-server-3bdfef910708eaba19daaf7d1d992cd4575af3b4.tar.gz
nextcloud-server-3bdfef910708eaba19daaf7d1d992cd4575af3b4.zip
Add the request type to the action
Diffstat (limited to 'lib/private/notification')
-rw-r--r--lib/private/notification/action.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/private/notification/action.php b/lib/private/notification/action.php
index 09e37a70d5e..2f7c1a5b5f4 100644
--- a/lib/private/notification/action.php
+++ b/lib/private/notification/action.php
@@ -35,6 +35,9 @@ class Action implements IAction {
protected $link;
/** @var string */
+ protected $requestType;
+
+ /** @var string */
protected $icon;
/**
@@ -44,6 +47,7 @@ class Action implements IAction {
$this->label = '';
$this->labelParsed = '';
$this->link = '';
+ $this->requestType = '';
$this->icon = '';
}
@@ -93,14 +97,18 @@ class Action implements IAction {
/**
* @param string $link
+ * @param string $requestType
* @return $this
* @throws \InvalidArgumentException if the link is invalid
* @since 8.2.0
*/
- public function setLink($link) {
+ public function setLink($link, $requestType) {
if (!is_string($link) || $link === '' || isset($link[256])) {
throw new \InvalidArgumentException('The given link is invalid');
}
+ if (!in_array($requestType, ['GET', 'POST', 'PUT', 'DELETE'])) {
+ throw new \InvalidArgumentException('The given request type is invalid');
+ }
$this->link = $link;
return $this;
}