|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* @copyright Copyright (c) 2020, Georg Ehrke |
|
7
|
|
|
* |
|
8
|
|
|
* @author Georg Ehrke <[email protected]> |
|
9
|
|
|
* |
|
10
|
|
|
* @license AGPL-3.0 |
|
11
|
|
|
* |
|
12
|
|
|
* This code is free software: you can redistribute it and/or modify |
|
13
|
|
|
* it under the terms of the GNU Affero General Public License, version 3, |
|
14
|
|
|
* as published by the Free Software Foundation. |
|
15
|
|
|
* |
|
16
|
|
|
* This program is distributed in the hope that it will be useful, |
|
17
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
18
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
19
|
|
|
* GNU Affero General Public License for more details. |
|
20
|
|
|
* |
|
21
|
|
|
* You should have received a copy of the GNU Affero General Public License, version 3, |
|
22
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/> |
|
23
|
|
|
* |
|
24
|
|
|
*/ |
|
25
|
|
|
namespace OCA\DAV\Events; |
|
26
|
|
|
|
|
27
|
|
|
use OCP\EventDispatcher\Event; |
|
28
|
|
|
|
|
29
|
|
|
/** |
|
30
|
|
|
* Class CardCreatedEvent |
|
31
|
|
|
* |
|
32
|
|
|
* @package OCA\DAV\Events |
|
33
|
|
|
* @since 20.0.0 |
|
34
|
|
|
*/ |
|
35
|
|
|
class CardCreatedEvent extends Event { |
|
36
|
|
|
|
|
37
|
|
|
/** @var int */ |
|
38
|
|
|
private $addressBookId; |
|
39
|
|
|
|
|
40
|
|
|
/** @var array */ |
|
41
|
|
|
private $addressBookData; |
|
42
|
|
|
|
|
43
|
|
|
/** @var array */ |
|
44
|
|
|
private $shares; |
|
45
|
|
|
|
|
46
|
|
|
/** @var array */ |
|
47
|
|
|
private $cardData; |
|
48
|
|
|
|
|
49
|
|
|
/** |
|
50
|
|
|
* CardCreatedEvent constructor. |
|
51
|
|
|
* |
|
52
|
|
|
* @param int $addressBookId |
|
53
|
|
|
* @param array $addressBookData |
|
54
|
|
|
* @param array $shares |
|
55
|
|
|
* @param array $cardData |
|
56
|
|
|
* @since 20.0.0 |
|
57
|
|
|
*/ |
|
58
|
|
|
public function __construct(int $addressBookId, |
|
59
|
|
|
array $addressBookData, |
|
60
|
|
|
array $shares, |
|
61
|
|
|
array $cardData) { |
|
62
|
|
|
parent::__construct(); |
|
63
|
|
|
$this->addressBookId = $addressBookId; |
|
64
|
|
|
$this->addressBookData = $addressBookData; |
|
65
|
|
|
$this->shares = $shares; |
|
66
|
|
|
$this->cardData = $cardData; |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
|
|
/** |
|
70
|
|
|
* @return int |
|
71
|
|
|
* @since 20.0.0 |
|
72
|
|
|
*/ |
|
73
|
|
|
public function getAddressBookId(): int { |
|
74
|
|
|
return $this->addressBookId; |
|
75
|
|
|
} |
|
76
|
|
|
|
|
77
|
|
|
/** |
|
78
|
|
|
* @return array |
|
79
|
|
|
* @since 20.0.0 |
|
80
|
|
|
*/ |
|
81
|
|
|
public function getAddressBookData(): array { |
|
82
|
|
|
return $this->addressBookData; |
|
83
|
|
|
} |
|
84
|
|
|
|
|
85
|
|
|
/** |
|
86
|
|
|
* @return array |
|
87
|
|
|
* @since 20.0.0 |
|
88
|
|
|
*/ |
|
89
|
|
|
public function getShares(): array { |
|
90
|
|
|
return $this->shares; |
|
91
|
|
|
} |
|
92
|
|
|
|
|
93
|
|
|
/** |
|
94
|
|
|
* @return array |
|
95
|
|
|
* @since 20.0.0 |
|
96
|
|
|
*/ |
|
97
|
|
|
public function getCardData(): array { |
|
98
|
|
|
return $this->cardData; |
|
99
|
|
|
} |
|
100
|
|
|
} |
|
101
|
|
|
|