id = $data['_id'] !== null ? (string)$data['_id'] : null; elseif (array_key_exists('id', $data)) $this->id = $data['id'] !== null ? (string)$data['id'] : null; if (array_key_exists('namespace', $data)) $this->namespace = $data['namespace'] !== null ? (string)$data['namespace'] : null; if (array_key_exists('handle', $data)) $this->handle = $data['handle'] !== null ? (string)$data['handle'] : null; if (array_key_exists('installed', $data)) $this->installed = (bool)$data['installed']; if (array_key_exists('enabled', $data)) $this->enabled = (bool)$data['enabled']; if (array_key_exists('version', $data)) $this->version = (string)$data['version']; return $this; } /** * Serialize to JSON-friendly structure. */ public function jsonSerialize(): array { return [ 'id' => $this->id, 'namespace' => $this->namespace, 'handle' => $this->handle, 'installed' => $this->installed, 'enabled' => $this->enabled, 'version' => $this->version, ]; } public function getId(): ?string { return $this->id; } public function setId(string $value): self { $this->id = $value; return $this; } public function getNamespace(): ?string { return $this->namespace; } public function setNamespace(string $value): self { $this->namespace = $value; return $this; } public function getHandle(): ?string { return $this->handle; } public function setHandle(string $value): self { $this->handle = $value; return $this; } public function getInstalled(): bool { return $this->installed; } public function setInstalled(bool $value): self { $this->installed = $value; return $this; } public function getEnabled(): bool { return $this->enabled; } public function setEnabled(bool $value): self { $this->enabled = $value; return $this; } public function getVersion(): string { return $this->version; } public function setVersion(string $value): self { $this->version = $value; return $this; } }