Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: missing enabled attribute #42

Merged
merged 2 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ test-service-account.json
localBackup/
.vscode/
.env.prod
serviceAccount.json
serviceAccount.json
.phpactor.json
8 changes: 8 additions & 0 deletions src/Migration/Resources/Database/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -53,6 +54,7 @@ public static function fromArray(array $array): self
permissions: $array['permissions'] ?? [],
createdAt: $array['createdAt'] ?? '',
updatedAt: $array['updatedAt'] ?? '',
enabled: $array['enabled'] ?? true,
);
}

Expand All @@ -69,6 +71,7 @@ public function jsonSerialize(): array
'permissions' => $this->permissions,
'createdAt' => $this->createdAt,
'updatedAt' => $this->updatedAt,
'enabled' => $this->enabled,
]);
}

Expand Down Expand Up @@ -96,4 +99,9 @@ public function getDocumentSecurity(): bool
{
return $this->documentSecurity;
}

public function getEnabled(): bool
{
return $this->enabled;
}
}
8 changes: 8 additions & 0 deletions src/Migration/Resources/Database/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public function __construct(
private readonly string $name = '',
protected string $createdAt = '',
protected string $updatedAt = '',
protected bool $enabled = true,
) {
$this->id = $id;
}
Expand All @@ -39,6 +40,7 @@ public static function fromArray(array $array): self
$array['name'],
createdAt: $array['createdAt'] ?? '',
updatedAt: $array['updatedAt'] ?? '',
enabled: $array['enabled'] ?? true,
);
}

Expand All @@ -52,6 +54,7 @@ public function jsonSerialize(): array
'name' => $this->name,
'createdAt' => $this->createdAt,
'updatedAt' => $this->updatedAt,
'enabled' => $this->enabled,
];
}

Expand All @@ -69,4 +72,9 @@ public function getDatabaseName(): string
{
return $this->name;
}

public function getEnabled(): bool
{
return $this->enabled;
}
}
Loading