diff options
author | Roeland Douma <rullzer@users.noreply.github.com> | 2016-05-12 09:48:11 +0200 |
---|---|---|
committer | Thomas Müller <DeepDiver1975@users.noreply.github.com> | 2016-05-12 09:48:11 +0200 |
commit | 56f4c4bed98eef9e422e7283e9c77cce15c312fd (patch) | |
tree | 7be94c56f805f052982379d81bfe84a6365430ce /lib/public/Comments/CommentsEvent.php | |
parent | 9b05f37fad88fdf78fdfee9473c27ba5be12abb2 (diff) | |
download | nextcloud-server-56f4c4bed98eef9e422e7283e9c77cce15c312fd.tar.gz nextcloud-server-56f4c4bed98eef9e422e7283e9c77cce15c312fd.zip |
Move \OCP\Comments to PSR-4 (#24565)
Diffstat (limited to 'lib/public/Comments/CommentsEvent.php')
-rw-r--r-- | lib/public/Comments/CommentsEvent.php | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/lib/public/Comments/CommentsEvent.php b/lib/public/Comments/CommentsEvent.php new file mode 100644 index 00000000000..3101c4e6c50 --- /dev/null +++ b/lib/public/Comments/CommentsEvent.php @@ -0,0 +1,70 @@ +<?php +/** + * @author Joas Schilling <nickvergessen@owncloud.com> + * + * @copyright Copyright (c) 2016, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace OCP\Comments; + +use Symfony\Component\EventDispatcher\Event; + +/** + * Class CommentsEvent + * + * @package OCP\Comments + * @since 9.0.0 + */ +class CommentsEvent extends Event { + + const EVENT_ADD = 'OCP\Comments\ICommentsManager::addComment'; + const EVENT_UPDATE = 'OCP\Comments\ICommentsManager::updateComment'; + 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; + } +} |