aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/Comments/CommentsEvent.php
blob: 04d592d4f1e98f9351186167edf38d4d18defee0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php

/**
 * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
 * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
 * SPDX-License-Identifier: AGPL-3.0-only
 */
namespace OCP\Comments;

use OCP\EventDispatcher\Event;

/**
 * Class CommentsEvent
 *
 * @since 9.0.0
 */
class CommentsEvent extends Event {
	/**
	 * @since 11.0.0
	 * @deprecated 22.0.0
	 */
	public const EVENT_ADD = 'OCP\Comments\ICommentsManager::addComment';

	/**
	 * @since 11.0.0
	 * @deprecated 22.0.0
	 */
	public const EVENT_PRE_UPDATE = 'OCP\Comments\ICommentsManager::preUpdateComment';

	/**
	 * @since 11.0.0
	 * @deprecated 22.0.0
	 */
	public const EVENT_UPDATE = 'OCP\Comments\ICommentsManager::updateComment';

	/**
	 * @since 11.0.0
	 * @deprecated 22.0.0
	 */
	public const EVENT_DELETE = 'OCP\Comments\ICommentsManager::deleteComment';

	/** @var string */
	protected $event;
	/** @var IComment */
	protected $comment;

	/**
	 * DispatcherEvent constructor.
	 *
	 * @param string $event
	 * @param IComment $comment
	 * @since 9.0.0
	 */
	public function __construct($event, IComment $comment) {
		$this->event = $event;
		$this->comment = $comment;
	}

	/**
	 * @return string
	 * @since 9.0.0
	 */
	public function getEvent() {
		return $this->event;
	}

	/**
	 * @return IComment
	 * @since 9.0.0
	 */
	public function getComment() {
		return $this->comment;
	}
}