diff options
author | Thomas Citharel <tcit@tcit.fr> | 2022-12-08 10:55:19 +0100 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2023-03-13 11:52:57 +0100 |
commit | f1751c44286930ea4ef41b046cdc4570330ee301 (patch) | |
tree | d5e403dfc0ab94bcf73a0490edba8de0e5365150 /lib/public/App | |
parent | ade49e0b15e408bf00dd24f5641bd9a29a18f05c (diff) | |
download | nextcloud-server-f1751c44286930ea4ef41b046cdc4570330ee301.tar.gz nextcloud-server-f1751c44286930ea4ef41b046cdc4570330ee301.zip |
Introduced app enable/disable/update typed events
OCP\App\ManagerEvent is depreciated since 22 without a replacement
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Diffstat (limited to 'lib/public/App')
-rw-r--r-- | lib/public/App/Events/AppDisableEvent.php | 51 | ||||
-rw-r--r-- | lib/public/App/Events/AppEnableEvent.php | 62 | ||||
-rw-r--r-- | lib/public/App/Events/AppUpdateEvent.php | 51 |
3 files changed, 164 insertions, 0 deletions
diff --git a/lib/public/App/Events/AppDisableEvent.php b/lib/public/App/Events/AppDisableEvent.php new file mode 100644 index 00000000000..5a50587446f --- /dev/null +++ b/lib/public/App/Events/AppDisableEvent.php @@ -0,0 +1,51 @@ +<?php + +declare(strict_types=1); + +/** + * @copyright Copyright (c) 2022, Thomas Citharel <nextcloud@tcit.fr> + * + * @author Thomas Citharel <nextcloud@tcit.fr> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * 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 + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +namespace OCP\App\Events; + +use OCP\EventDispatcher\Event; + +/** + * @since 27.0.0 + */ +class AppDisableEvent extends Event { + private string $appId; + + /** + * @since 27.0.0 + */ + public function __construct(string $appId) { + parent::__construct(); + + $this->appId = $appId; + } + + /** + * @since 27.0.0 + */ + public function getAppId(): string { + return $this->appId; + } +} diff --git a/lib/public/App/Events/AppEnableEvent.php b/lib/public/App/Events/AppEnableEvent.php new file mode 100644 index 00000000000..1aff3630f86 --- /dev/null +++ b/lib/public/App/Events/AppEnableEvent.php @@ -0,0 +1,62 @@ +<?php + +declare(strict_types=1); + +/** + * @copyright Copyright (c) 2022, Thomas Citharel <nextcloud@tcit.fr> + * + * @author Thomas Citharel <nextcloud@tcit.fr> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * 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 + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +namespace OCP\App\Events; + +use OCP\EventDispatcher\Event; + +/** + * @since 27.0.0 + */ +class AppEnableEvent extends Event { + private string $appId; + /** @var string[] */ + private array $groupIds; + + /** + * @param string[] $groupIds + * @since 27.0.0 + */ + public function __construct(string $appId, array $groupIds = []) { + parent::__construct(); + + $this->appId = $appId; + $this->groupIds = $groupIds; + } + + /** + * @since 27.0.0 + */ + public function getAppId(): string { + return $this->appId; + } + + /** + * @since 27.0.0 + */ + public function getGroupIds(): array { + return $this->groupIds; + } +} diff --git a/lib/public/App/Events/AppUpdateEvent.php b/lib/public/App/Events/AppUpdateEvent.php new file mode 100644 index 00000000000..92f1f8f9b16 --- /dev/null +++ b/lib/public/App/Events/AppUpdateEvent.php @@ -0,0 +1,51 @@ +<?php + +declare(strict_types=1); + +/** + * @copyright Copyright (c) 2022, Thomas Citharel <nextcloud@tcit.fr> + * + * @author Thomas Citharel <nextcloud@tcit.fr> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * 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 + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +namespace OCP\App\Events; + +use OCP\EventDispatcher\Event; + +/** + * @since 27.0.0 + */ +class AppUpdateEvent extends Event { + private string $appId; + + /** + * @since 27.0.0 + */ + public function __construct(string $appId) { + parent::__construct(); + + $this->appId = $appId; + } + + /** + * @since 27.0.0 + */ + public function getAppId(): string { + return $this->appId; + } +} |