public function __toString() { $type = strtoupper($this->getType()); $method = 'toString' . $type; return $this->{$method}($this->toArray()); }