diff --git a/.gitignore b/.gitignore index d16782c..3a71c86 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ test-service-account.json localBackup/ .vscode/ .env.prod -serviceAccount.json \ No newline at end of file +serviceAccount.json +.phpactor.json \ No newline at end of file diff --git a/src/Migration/Resources/Database/Collection.php b/src/Migration/Resources/Database/Collection.php index 1f91d5a..b928167 100644 --- a/src/Migration/Resources/Database/Collection.php +++ b/src/Migration/Resources/Database/Collection.php @@ -24,6 +24,7 @@ public function __construct( array $permissions = [], protected string $createdAt = '', protected string $updatedAt = '', + protected bool $enabled = true, ) { $this->id = $id; $this->permissions = $permissions; @@ -53,6 +54,7 @@ public static function fromArray(array $array): self permissions: $array['permissions'] ?? [], createdAt: $array['createdAt'] ?? '', updatedAt: $array['updatedAt'] ?? '', + enabled: $array['enabled'] ?? true, ); } @@ -69,6 +71,7 @@ public function jsonSerialize(): array 'permissions' => $this->permissions, 'createdAt' => $this->createdAt, 'updatedAt' => $this->updatedAt, + 'enabled' => $this->enabled, ]); } @@ -96,4 +99,9 @@ public function getDocumentSecurity(): bool { return $this->documentSecurity; } + + public function getEnabled(): bool + { + return $this->enabled; + } } diff --git a/src/Migration/Resources/Database/Database.php b/src/Migration/Resources/Database/Database.php index c2fc0bd..c297d6e 100644 --- a/src/Migration/Resources/Database/Database.php +++ b/src/Migration/Resources/Database/Database.php @@ -20,6 +20,7 @@ public function __construct( private readonly string $name = '', protected string $createdAt = '', protected string $updatedAt = '', + protected bool $enabled = true, ) { $this->id = $id; } @@ -39,6 +40,7 @@ public static function fromArray(array $array): self $array['name'], createdAt: $array['createdAt'] ?? '', updatedAt: $array['updatedAt'] ?? '', + enabled: $array['enabled'] ?? true, ); } @@ -52,6 +54,7 @@ public function jsonSerialize(): array 'name' => $this->name, 'createdAt' => $this->createdAt, 'updatedAt' => $this->updatedAt, + 'enabled' => $this->enabled, ]; } @@ -69,4 +72,9 @@ public function getDatabaseName(): string { return $this->name; } + + public function getEnabled(): bool + { + return $this->enabled; + } }