$this->type, "sender" => $this->sender, "event_id" => $this->id, "origin_server_ts" => $this->originServerTimestamp->format("U.v"), "content" => [ "body" => $this->body, "msgtype" => MessageType::TEXT, ], "unsigned" => [ "age" => 1234, "membership" => MembershipState::JOIN, ], "room_id" => $this->roomId, ]; } public static function fromDatabase(array $row): self { } public static function fetch(): ?self { } public static function fetchAll(): array { } public function insert(): bool { return !! Database::getInstance()->query( << $this->id, "type" => $this->type->value, "sender" => $this->sender, "origin_server_timestamp" => (new \DateTime("now"))->format("U.v"), "content" => json_encode($this->content), "unsigned" => json_encode($this->unsigned), "room_id" => $this->roomId, ] ); } public function update(): bool { } public function delete(): bool { } }