public function __toString() { $out = 'New instance'; if ($this->ouuid) { $out = $this->ouuid; } if ($this->contentType) { $out = $this->contentType->getName() . ':' . $out; if (!empty($this->id)) { $out .= '#' . $this->id; } } if ($this->contentType && $this->contentType->getLabelField() && $this->rawData && isset($this->rawData[$this->contentType->getLabelField()])) { return $this->rawData[$this->contentType->getLabelField()] . " ({$out})"; } return $out; }