diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-08-22 16:56:01 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-08-25 16:13:47 +0200 |
commit | a83a8f0dde07bff67e0ceb7008cc26b3fad32516 (patch) | |
tree | a1dcc3e67eab7f2ff56a0fc60aa3f19387b943cd /lib/private/DB/MigratorExecuteSqlEvent.php | |
parent | 5aac997d448da55f1c43648b1e5cf1a9c1360d6c (diff) | |
download | nextcloud-server-a83a8f0dde07bff67e0ceb7008cc26b3fad32516.tar.gz nextcloud-server-a83a8f0dde07bff67e0ceb7008cc26b3fad32516.zip |
Migrate Migrator::executeSql to OCP\EventDispatcher\Event
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib/private/DB/MigratorExecuteSqlEvent.php')
-rw-r--r-- | lib/private/DB/MigratorExecuteSqlEvent.php | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/lib/private/DB/MigratorExecuteSqlEvent.php b/lib/private/DB/MigratorExecuteSqlEvent.php new file mode 100644 index 00000000000..d8a0e2ac3ad --- /dev/null +++ b/lib/private/DB/MigratorExecuteSqlEvent.php @@ -0,0 +1,52 @@ +<?php +/** + * @copyright Copyright (c) 2022 Côme Chilliet <come.chilliet@nextcloud.com> + * + * @author Côme Chilliet <come.chilliet@nextcloud.com> + * + * @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 OC\DB; + +use OCP\EventDispatcher\Event; + +class MigratorExecuteSqlEvent extends Event { + private string $sql; + private int $current; + private int $max; + + public function __construct( + string $sql, + int $current, + int $max, + ) { + $this->sql = $sql; + $this->current = $current; + $this->max = $max; + } + + public function getSql(): string { + return $this->sql; + } + + public function getCurrentStep(): int { + return $this->current; + } + + public function getMaxStep(): int { + return $this->max; + } +} |