Completed
Push — master ( 0c68cd...766ef1 )
by Maxence
02:02
created

GroupFolderMount::setId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 5
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 5
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
/**
3
 * Files_FullTextSearch - Index the content of your files
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 2018
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\Files_FullTextSearch\Model;
28
29 View Code Duplication
class GroupFolderMount implements \JsonSerializable {
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
30
31
32
	/** @var int */
33
	private $id;
34
35
	/** @var string */
36
	private $path;
37
38
	/** @var bool */
39
	private $global;
40
41
	/** @var array */
42
	private $groups;
43
44
	/** @var array */
45
	private $users;
46
47
48
	/**
49
	 * @return int
50
	 */
51
	public function getId() {
52
		return $this->id;
53
	}
54
55
	/**
56
	 * @param int $id
57
	 *
58
	 * @return $this
59
	 */
60
	public function setId($id) {
61
		$this->id = $id;
62
63
		return $this;
64
	}
65
66
67
	/**
68
	 * @return string
69
	 */
70
	public function getPath() {
71
		return $this->path;
72
	}
73
74
	/**
75
	 * @param string $path
76
	 *
77
	 * @return $this
78
	 */
79
	public function setPath($path) {
80
		$this->path = $path;
81
82
		return $this;
83
	}
84
85
86
	/**
87
	 * @return bool
88
	 */
89
	public function isGlobal() {
90
		return $this->global;
91
	}
92
93
	/**
94
	 * @param bool $global
95
	 *
96
	 * @return $this
97
	 */
98
	public function setGlobal($global) {
99
		$this->global = $global;
100
101
		return $this;
102
	}
103
104
105
	/**
106
	 * @return array
107
	 */
108
	public function getGroups() {
109
		return $this->groups;
110
	}
111
112
	/**
113
	 * @param array $groups
114
	 *
115
	 * @return $this
116
	 */
117
	public function setGroups($groups) {
118
		$this->groups = $groups;
119
120
		return $this;
121
	}
122
123
124
	/**
125
	 * @return array
126
	 */
127
	public function getUsers() {
128
		return $this->users;
129
	}
130
131
	/**
132
	 * @param array $users
133
	 *
134
	 * @return $this
135
	 */
136
	public function setUsers($users) {
137
		$this->users = $users;
138
139
		return $this;
140
	}
141
142
143
	public function __destruct() {
144
		unset($this->id);
145
		unset($this->path);
146
		unset($this->global);
147
		unset($this->groups);
148
		unset($this->users);
149
	}
150
151
	public function jsonSerialize() {
152
		return [
153
			'id'     => $this->getId(),
154
			'path'   => $this->getPath(),
155
			'global' => $this->isGlobal(),
156
			'groups' => $this->getGroups(),
157
			'users'  => $this->getUsers()
158
		];
159
	}
160
161
}