Property Visibilities

This commit is contained in:
2023-01-07 15:34:05 +01:00
parent 99bfd7e505
commit d115d8b970
30 changed files with 241 additions and 215 deletions

View File

@@ -42,13 +42,14 @@ namespace Core\Objects\DatabaseEntity {
setcookie('lang', $this->code, 0, "/", $domain, false, false);
}
public function jsonSerialize(): array {
return array(
'id' => $this->getId(),
'code' => $this->code,
'shortCode' => explode("_", $this->code)[0],
'name' => $this->name,
);
public function jsonSerialize(?array $propertyNames = null): array {
$jsonData = parent::jsonSerialize($propertyNames);
if ($propertyNames === null || in_array("shortCode", $propertyNames)) {
$jsonData["shortCode"] = explode("_", $this->code)[0];
}
return $jsonData;
}
public function activate() {