Completed
Pull Request — master (#32303)
by Victor
10:56
created

FileNotification   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 49
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getResourceType() 0 3 1
A getNotificationType() 0 3 1
A setNotificationType() 0 3 1
A getNotificationTypes() 0 10 1
1
<?php
2
/**
3
 * @author Viktar Dubiniuk <[email protected]>
4
 *
5
 * @copyright Copyright (c) 2018, ownCloud GmbH
6
 * @license AGPL-3.0
7
 *
8
 * This code is free software: you can redistribute it and/or modify
9
 * it under the terms of the GNU Affero General Public License, version 3,
10
 * as published by the Free Software Foundation.
11
 *
12
 * This program is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
 * GNU Affero General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU Affero General Public License, version 3,
18
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
19
 *
20
 */
21
22
namespace OCA\FederatedFileSharing\Ocm\Notification;
23
24
/**
25
 * Class Notification
26
 *
27
 * @package OCA\FederatedFileSharing\Ocm
28
 */
29
class FileNotification extends Notification {
30
	const NOTIFICATION_TYPE_SHARE_ACCEPTED = 'SHARE_ACCEPTED';
31
	const NOTIFICATION_TYPE_SHARE_DECLINED = 'SHARE_DECLINED';
32
	const NOTIFICATION_TYPE_SHARE_UNSHARED = 'SHARE_UNSHARED';
33
	const NOTIFICATION_TYPE_REQUEST_RESHARE = 'REQUEST_RESHARE';
34
	const NOTIFICATION_TYPE_RESHARE_UNDO = 'RESHARE_UNDO';
35
	const NOTIFICATION_TYPE_RESHARE_CHANGE_PERMISSION = 'RESHARE_CHANGE_PERMISSION';
36
37
	const RESOURCE_TYPE_FILE = 'file';
38
39
	/**
40
	 * @return string
41
	 */
42
	public function getResourceType() {
43
		return self::RESOURCE_TYPE_FILE;
44
	}
45
46
	/**
47
	 * @return string
48
	 */
49
	public function getNotificationType() {
50
		return $this->notificationType;
51
	}
52
53
	/**
54
	 * @param string $notificationType
55
	 *
56
	 * @return void
57
	 */
58
	public function setNotificationType($notificationType) {
59
		$this->notificationType = $notificationType;
60
	}
61
62
	/**
63
	 * Get all available notification types
64
	 *
65
	 * @return string[]
66
	 */
67
	public function getNotificationTypes() {
68
		return [
69
			self::NOTIFICATION_TYPE_SHARE_ACCEPTED,
70
			self::NOTIFICATION_TYPE_SHARE_DECLINED,
71
			self::NOTIFICATION_TYPE_SHARE_UNSHARED,
72
			self::NOTIFICATION_TYPE_REQUEST_RESHARE,
73
			self::NOTIFICATION_TYPE_RESHARE_UNDO,
74
			self::NOTIFICATION_TYPE_RESHARE_CHANGE_PERMISSION
75
		];
76
	}
77
}
78