123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- declare(strict_types=1);
- namespace OCP\UserMigration;
- trait TMigratorBasicVersionHandling {
- protected int $version = 1;
- protected bool $mandatory = false;
-
- public function getVersion(): int {
- return $this->version;
- }
-
- public function canImport(
- IImportSource $importSource,
- ): bool {
- $version = $importSource->getMigratorVersion($this->getId());
- if ($version === null) {
- return !$this->mandatory;
- }
- return ($this->version >= $version);
- }
- }
|