Skip to content

Commit

Permalink
Merge pull request #42 from utopia-php/fix-missing-enabled-attribute
Browse files Browse the repository at this point in the history
fix: missing enabled attribute
  • Loading branch information
TorstenDittmann authored Oct 2, 2024
2 parents 6ac8a01 + 29513de commit d7d3e2e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
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;
}
}

0 comments on commit d7d3e2e

Please sign in to comment.