Completed
Pull Request — master (#32767)
by Victor
09:35
created

Share20OcsController::acceptShare()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
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\Files_Sharing\Controller;
23
24
use OCA\Files_Sharing\API\Share20OCS;
25
use OCP\AppFramework\OCSController;
26
use OCP\IRequest;
27
28
/**
29
 * Class Share20OcsController
30
 *
31
 * @package OCA\Files_Sharing\Controller
32
 */
33
class Share20OcsController extends OCSController {
34
	/** @var Share20OCS */
35
	private $share20Ocs;
36
37
	public function __construct($appName, IRequest $request, Share20OCS $share20Ocs) {
38
		parent::__construct($appName, $request);
39
		$this->share20Ocs = $share20Ocs;
40
	}
41
42
	public function getShares() {
43
		return $this->share20Ocs->getShares();
44
	}
45
46
	public function createShare() {
47
		return $this->share20Ocs->createShare();
48
	}
49
50
	/**
51
	 * @param int $id
52
	 * @return \OC\OCS\Result
53
	 */
54
	public function getShare($id) {
55
		return $this->share20Ocs->getShare($id);
56
	}
57
58
	/**
59
	 * @param int $id
60
	 * @return \OC\OCS\Result
61
	 */
62
	public function updateShare($id) {
63
		return $this->share20Ocs->updateShare($id);
64
	}
65
66
	/**
67
	 * @param int $id
68
	 * @return \OC\OCS\Result
69
	 */
70
	public function deleteShare($id) {
71
		return $this->share20Ocs->deleteShare($id);
72
	}
73
74
	/**
75
	 * @param int $id
76
	 * @return \OC\OCS\Result
77
	 */
78
	public function acceptShare($id) {
79
		return $this->share20Ocs->acceptShare($id);
80
	}
81
82
	/**
83
	 * @param int $id
84
	 * @return \OC\OCS\Result
85
	 */
86
	public function declineShare($id) {
87
		return $this->share20Ocs->declineShare($id);
88
	}
89
}
90