1 | <?php |
||
26 | class Subscription extends AbstractHook |
||
27 | { |
||
28 | /** |
||
29 | * Notifier. |
||
30 | * |
||
31 | * @var Notifier |
||
32 | */ |
||
33 | protected $notifier; |
||
34 | |||
35 | /** |
||
36 | * Server. |
||
37 | * |
||
38 | * @var Server |
||
39 | */ |
||
40 | protected $server; |
||
41 | |||
42 | /** |
||
43 | * Logger. |
||
44 | * |
||
45 | * @var LoggerInterface |
||
46 | */ |
||
47 | protected $logger; |
||
48 | |||
49 | /** |
||
50 | * ACL. |
||
51 | * |
||
52 | * @var Acl |
||
53 | */ |
||
54 | protected $acl; |
||
55 | |||
56 | /** |
||
57 | * Constructor. |
||
58 | */ |
||
59 | public function __construct(Notifier $notifier, Server $server, Acl $acl, LoggerInterface $logger) |
||
66 | |||
67 | /** |
||
68 | * {@inheritdoc} |
||
69 | */ |
||
70 | public function postCreateCollection(Collection $parent, Collection $node, bool $clone): void |
||
74 | |||
75 | /** |
||
76 | * {@inheritdoc} |
||
77 | */ |
||
78 | public function postCreateFile(Collection $parent, File $node, bool $clone): void |
||
82 | |||
83 | /** |
||
84 | * {@inheritdoc} |
||
85 | */ |
||
86 | public function postDeleteCollection(Collection $node, bool $force, ?string $recursion, bool $recursion_first): void |
||
90 | |||
91 | /** |
||
92 | * {@inheritdoc} |
||
93 | */ |
||
94 | public function postRestoreFile(File $node, int $version): void |
||
98 | |||
99 | /** |
||
100 | * {@inheritdoc} |
||
101 | */ |
||
102 | public function postDeleteFile(File $node, bool $force, ?string $recursion, bool $recursion_first): void |
||
106 | |||
107 | /** |
||
108 | * {@inheritdoc} |
||
109 | */ |
||
110 | public function postPutFile(File $node): void |
||
114 | |||
115 | /** |
||
116 | * {@inheritdoc} |
||
117 | */ |
||
118 | public function postSaveNodeAttributes(NodeInterface $node, array $attributes, array $remove, ?string $recursion, bool $recursion_first): void |
||
125 | |||
126 | /** |
||
127 | * Check if we need to notify. |
||
128 | */ |
||
129 | protected function notify(NodeInterface $node): bool |
||
144 | |||
145 | /** |
||
146 | * Send. |
||
147 | */ |
||
148 | protected function send(NodeInterface $node, NodeInterface $subscription, array $receiver) |
||
175 | |||
176 | /** |
||
177 | * Get receiver list. |
||
178 | */ |
||
179 | protected function getReceiver(NodeInterface $node): array |
||
212 | |||
213 | /** |
||
214 | * Only send notifcation if node is accessible by user. |
||
215 | */ |
||
216 | protected function filterAccess(NodeInterface $node, iterable $receiver): Generator |
||
233 | } |
||
234 |