Completed
Push — federated-circles ( 80cab6...74a72b )
by Maxence
02:32
created

FederatedLink::setRemoteCircleName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
/**
3
 * Circles - Bring cloud-users closer together.
4
 *
5
 * This file is licensed under the Affero General Public License version 3 or
6
 * later. See the COPYING file.
7
 *
8
 * @author Maxence Lange <[email protected]>
9
 * @copyright 2017
10
 * @license GNU AGPL version 3 or any later version
11
 *
12
 * This program is free software: you can redistribute it and/or modify
13
 * it under the terms of the GNU Affero General Public License as
14
 * published by the Free Software Foundation, either version 3 of the
15
 * License, or (at your option) any later version.
16
 *
17
 * This program is distributed in the hope that it will be useful,
18
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
 * GNU Affero General Public License for more details.
21
 *
22
 * You should have received a copy of the GNU Affero General Public License
23
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
24
 *
25
 */
26
27
namespace OCA\Circles\Model;
28
29
class FederatedLink implements \JsonSerializable {
30
31
32
	/** @var string */
33
	private $token;
34
35
	/** @var string */
36
	private $address;
37
38
	/** @var int */
39
	private $status;
40
41
	/** @var int */
42
	private $creation;
43
44
	/** @var int */
45
	private $remoteCircleId;
46
47
	/** @var string */
48
	private $remoteCircleName;
49
50
51
	public function __construct() {
52
	}
53
54
55
	/**
56
	 * @param $token
57
	 *
58
	 * @return $this
59
	 */
60
	public function setToken(string $token) {
61
		$this->token = $token;
62
63
		return $this;
64
	}
65
66
	/**
67
	 * @return string
68
	 */
69
	public function getToken() {
70
		return $this->token;
71
	}
72
73
74
	/**
75
	 * @param string $address
76
	 */
77
	public function setAddress(string $address) {
78
		$this->address = $address;
79
	}
80
81
	/**
82
	 * @return string
83
	 */
84
	public function getAddress() {
85
		return $this->address;
86
	}
87
88
89
	/**
90
	 * @param int $circleId
91
	 */
92
	public function setRemoteCircleId(int $circleId) {
93
		$this->remoteCircleId = $circleId;
94
	}
95
96
	/**
97
	 * @return int
98
	 */
99
	public function getRemoteCircleId() {
100
		return $this->remoteCircleId;
101
	}
102
103
104
	/**
105
	 * @param string $circleName
106
	 */
107
	public function setRemoteCircleName(string $circleName) {
108
		$this->remoteCircleName = $circleName;
109
	}
110
111
	/**
112
	 * @return string
113
	 */
114
	public function getRemoteCircleName() {
115
		return $this->remoteCircleName;
116
	}
117
118
119
	/**
120
	 * @param int $status
121
	 */
122
	public function setStatus(int $status) {
123
		$this->status = $status;
124
	}
125
126
	/**
127
	 * @return int
128
	 */
129
	public function getStatus() {
130
		return $this->status;
131
	}
132
133
134
	/**
135
	 * @param int $creation
136
	 */
137
	public function setCreation($creation) {
138
		if ($creation === null) {
139
			return;
140
		}
141
142
		$this->creation = $creation;
143
	}
144
145
	/**
146
	 * @return int
147
	 */
148
	public function getCreation() {
149
		return $this->creation;
150
	}
151
152
153
	public function jsonSerialize() {
154
		return array(
155
			'token'    => $this->getToken(),
156
			'address'  => $this->getAddress(),
157
			'status'   => $this->getStatus(),
158
			'creation' => $this->getCreation()
159
		);
160
	}
161
162
	public static function fromJSON($json) {
0 ignored issues
show
Unused Code introduced by
The parameter $json is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
163
	}
164
165
}