diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2019-12-22 15:04:39 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2020-01-02 16:40:49 +0100 |
commit | 25d4f3230d840d88191f905b2f3767d982c311b6 (patch) | |
tree | e37bb6b7784144a6c97800750aaa302637e04f0f /lib/public/WorkflowEngine/Events | |
parent | c347b7cc148f69f12f7d8e98e3e6fee3a026d11c (diff) | |
download | nextcloud-server-25d4f3230d840d88191f905b2f3767d982c311b6.tar.gz nextcloud-server-25d4f3230d840d88191f905b2f3767d982c311b6.zip |
Use the new Events in Flow
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/public/WorkflowEngine/Events')
3 files changed, 162 insertions, 0 deletions
diff --git a/lib/public/WorkflowEngine/Events/RegisterChecksEvent.php b/lib/public/WorkflowEngine/Events/RegisterChecksEvent.php new file mode 100644 index 00000000000..cb6cca8bfe2 --- /dev/null +++ b/lib/public/WorkflowEngine/Events/RegisterChecksEvent.php @@ -0,0 +1,54 @@ +<?php +declare(strict_types=1); +/** + * @copyright Copyright (c) 2019, Roeland Jago Douma <roeland@famdouma.nl> + * + * @author Roeland Jago Douma <roeland@famdouma.nl> + * + * @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\WorkflowEngine\Events; + +use OCP\EventDispatcher\Event; +use OCP\WorkflowEngine\ICheck; +use OCP\WorkflowEngine\IManager; + +/** + * @since 18.0.0 + */ +class RegisterChecksEvent extends Event { + + /** @var IManager */ + private $manager; + + /** + * @since 18.0.0 + */ + public function __construct(IManager $manager) { + parent::__construct(); + + $this->manager = $manager; + } + + /** + * @since 18.0.0 + */ + public function registerCheck(ICheck $check): void { + $this->manager->registerCheck($check); + } +} diff --git a/lib/public/WorkflowEngine/Events/RegisterEntitiesEvent.php b/lib/public/WorkflowEngine/Events/RegisterEntitiesEvent.php new file mode 100644 index 00000000000..f457a2b97b0 --- /dev/null +++ b/lib/public/WorkflowEngine/Events/RegisterEntitiesEvent.php @@ -0,0 +1,54 @@ +<?php +declare(strict_types=1); +/** + * @copyright Copyright (c) 2019, Roeland Jago Douma <roeland@famdouma.nl> + * + * @author Roeland Jago Douma <roeland@famdouma.nl> + * + * @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\WorkflowEngine\Events; + +use OCP\EventDispatcher\Event; +use OCP\WorkflowEngine\IEntity; +use OCP\WorkflowEngine\IManager; + +/** + * @since 18.0.0 + */ +class RegisterEntitiesEvent extends Event { + + /** @var IManager */ + private $manager; + + /** + * @since 18.0.0 + */ + public function __construct(IManager $manager) { + parent::__construct(); + + $this->manager = $manager; + } + + /** + * @since 18.0.0 + */ + public function registerEntity(IEntity $entity): void { + $this->manager->registerEntity($entity); + } +} diff --git a/lib/public/WorkflowEngine/Events/RegisterOperationsEvent.php b/lib/public/WorkflowEngine/Events/RegisterOperationsEvent.php new file mode 100644 index 00000000000..a6bbbcb545e --- /dev/null +++ b/lib/public/WorkflowEngine/Events/RegisterOperationsEvent.php @@ -0,0 +1,54 @@ +<?php +declare(strict_types=1); +/** + * @copyright Copyright (c) 2019, Roeland Jago Douma <roeland@famdouma.nl> + * + * @author Roeland Jago Douma <roeland@famdouma.nl> + * + * @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\WorkflowEngine\Events; + +use OCP\EventDispatcher\Event; +use OCP\WorkflowEngine\IManager; +use OCP\WorkflowEngine\IOperation; + +/** + * @since 18.0.0 + */ +class RegisterOperationsEvent extends Event { + + /** @var IManager */ + private $manager; + + /** + * @since 18.0.0 + */ + public function __construct(IManager $manager) { + parent::__construct(); + + $this->manager = $manager; + } + + /** + * @since 18.0.0 + */ + public function registerOperation(IOperation $operation): void { + $this->manager->registerOperation($operation); + } +} |