public function __toString() { $format = new TextFormat(); $stream = $format->encodeMessage($this); return $stream->__toString(); }