2016-02-05 04:45:16 -05:00
|
|
|
<?php
|
2024-05-23 03:26:56 -04:00
|
|
|
|
2016-02-05 04:45:16 -05:00
|
|
|
/**
|
2024-05-23 03:26:56 -04:00
|
|
|
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
2016-02-05 04:45:16 -05:00
|
|
|
*/
|
|
|
|
|
namespace OCP\Comments;
|
|
|
|
|
|
2019-10-16 06:36:03 -04:00
|
|
|
use OCP\EventDispatcher\Event;
|
2016-02-05 04:45:16 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Class CommentsEvent
|
|
|
|
|
*
|
|
|
|
|
* @since 9.0.0
|
|
|
|
|
*/
|
|
|
|
|
class CommentsEvent extends Event {
|
2021-02-09 07:53:41 -05:00
|
|
|
/**
|
2024-02-14 14:48:27 -05:00
|
|
|
* @since 11.0.0
|
2021-02-09 07:53:41 -05:00
|
|
|
* @deprecated 22.0.0
|
|
|
|
|
*/
|
2020-10-05 09:12:57 -04:00
|
|
|
public const EVENT_ADD = 'OCP\Comments\ICommentsManager::addComment';
|
2021-02-09 07:53:41 -05:00
|
|
|
|
|
|
|
|
/**
|
2024-02-14 14:48:27 -05:00
|
|
|
* @since 11.0.0
|
2021-02-09 07:53:41 -05:00
|
|
|
* @deprecated 22.0.0
|
|
|
|
|
*/
|
2020-04-10 10:54:27 -04:00
|
|
|
public const EVENT_PRE_UPDATE = 'OCP\Comments\ICommentsManager::preUpdateComment';
|
2021-02-09 07:53:41 -05:00
|
|
|
|
|
|
|
|
/**
|
2024-02-14 14:48:27 -05:00
|
|
|
* @since 11.0.0
|
2021-02-09 07:53:41 -05:00
|
|
|
* @deprecated 22.0.0
|
|
|
|
|
*/
|
2020-10-05 09:12:57 -04:00
|
|
|
public const EVENT_UPDATE = 'OCP\Comments\ICommentsManager::updateComment';
|
2021-02-09 07:53:41 -05:00
|
|
|
|
|
|
|
|
/**
|
2024-02-14 14:48:27 -05:00
|
|
|
* @since 11.0.0
|
2021-02-09 07:53:41 -05:00
|
|
|
* @deprecated 22.0.0
|
|
|
|
|
*/
|
2020-10-05 09:12:57 -04:00
|
|
|
public const EVENT_DELETE = 'OCP\Comments\ICommentsManager::deleteComment';
|
2016-02-05 04:45:16 -05:00
|
|
|
|
|
|
|
|
/** @var string */
|
|
|
|
|
protected $event;
|
|
|
|
|
/** @var IComment */
|
|
|
|
|
protected $comment;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* DispatcherEvent constructor.
|
|
|
|
|
*
|
|
|
|
|
* @param string $event
|
|
|
|
|
* @param IComment $comment
|
2016-02-24 06:42:34 -05:00
|
|
|
* @since 9.0.0
|
2016-02-05 04:45:16 -05:00
|
|
|
*/
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|