Browse Source

N°1104 DBObject::__toString() was way too verbose and returned all objects from linksets as string as well, causing memory limits.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@4971 a333f486-631f-4898-b8df-5754b55c2be0
glajarige 7 years ago
parent
commit
64dc0a14d5
1 changed files with 7 additions and 12 deletions
  1. 7 12
      core/dbobject.class.php

+ 7 - 12
core/dbobject.class.php

@@ -159,18 +159,13 @@ abstract class DBObject implements iDisplay
 
 	public function __toString()
 	{
-		$sRet = '';
-		$sClass = get_class($this);
-		$sRootClass = MetaModel::GetRootClass($sClass);
-		$iPKey = $this->GetKey();
-		$sRet .= "<b title=\"$sRootClass\">$sClass</b>::$iPKey<br/>\n";
-		$sRet .= "<ul class=\"treeview\">\n";
-		foreach(MetaModel::ListAttributeDefs(get_class($this)) as $sAttCode=>$oAttDef)
-		{
-			$sRet .= "<li>".$oAttDef->GetLabel()." = ".$this->GetAsHtml($sAttCode)."</li>\n";
-		}
-		$sRet .= "</ul>";
-		return $sRet;
+        $sRet = '';
+        $sClass = get_class($this);
+        $sRootClass = MetaModel::GetRootClass($sClass);
+        $iPKey = $this->GetKey();
+        $sFriendlyname = $this->Get('friendlyname');
+        $sRet .= "<b title=\"$sRootClass\">$sClass</b>::$iPKey ($sFriendlyname)<br/>\n";
+        return $sRet;
 	}
 	
 	// Restore initial values... mmmm, to be discussed