name = $data['name'] ?? null; $model->address = $data['address'] ?? null; $model->accessLevel = $data['access_level'] ?? null; $model->replyPreference = $data['reply_preference'] ?? null; $model->description = $data['description'] ?? null; $model->membersCount = (int) ($data['members_count'] ?? 0); $model->createdAt = isset($data['created_at']) ? new \DateTimeImmutable($data['created_at']) : null; return $model; } private function __construct() { } public function getName(): ?string { return $this->name; } public function getAddress(): ?string { return $this->address; } public function getAccessLevel(): ?string { return $this->accessLevel; } public function getReplyPreference(): ?string { return $this->replyPreference; } public function getDescription(): ?string { return $this->description; } public function getMembersCount(): int { return $this->membersCount; } public function getCreatedAt(): \DateTimeImmutable { return $this->createdAt; } }