1<?php
2/**
3 * @author Jörn Friedrich Dreyer <jfd@butonic.de>
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
22namespace OCP\Share\Events;
23
24use Symfony\Component\EventDispatcher\Event;
25
26/**
27 * Class ShareEvent
28 *
29 * @package OCP\Share\Events
30 * @since 10.0.2
31 */
32class ShareEvent extends Event {
33
34	// TODO when the sharing code uses a Share entity use that instead of an array
35	/** @var array */
36	private $share;
37
38	/**
39	 * ShareEvent constructor.
40	 *
41	 * @param array $share
42	 * @since 10.0.2
43	 */
44	public function __construct($share) {
45		$this->share = $share;
46	}
47
48	/**
49	 * @return array
50	 * @since 10.0.2
51	 */
52	public function getShare() {
53		return $this->share;
54	}
55
56	/**
57	 * @return string url
58	 * @since 10.0.2
59	 */
60	public function getRemote() {
61		return $this->share['remote'];
62	}
63
64	/**
65	 * @return string
66	 * @since 10.0.2
67	 */
68	public function getRemoteId() {
69		return $this->share['remote_id'];
70	}
71
72	/**
73	 * @return string
74	 * @since 10.0.2
75	 */
76	public function getShareToken() {
77		return $this->share['share_token'];
78	}
79}
80