mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 07:12:26 +02:00
N°1104 DBObject::__toString() was way too verbose and returned all objects from linksets as string as well, causing memory limits.
SVN:trunk[4971]
This commit is contained in:
@@ -159,18 +159,13 @@ abstract class DBObject implements iDisplay
|
|||||||
|
|
||||||
public function __toString()
|
public function __toString()
|
||||||
{
|
{
|
||||||
$sRet = '';
|
$sRet = '';
|
||||||
$sClass = get_class($this);
|
$sClass = get_class($this);
|
||||||
$sRootClass = MetaModel::GetRootClass($sClass);
|
$sRootClass = MetaModel::GetRootClass($sClass);
|
||||||
$iPKey = $this->GetKey();
|
$iPKey = $this->GetKey();
|
||||||
$sRet .= "<b title=\"$sRootClass\">$sClass</b>::$iPKey<br/>\n";
|
$sFriendlyname = $this->Get('friendlyname');
|
||||||
$sRet .= "<ul class=\"treeview\">\n";
|
$sRet .= "<b title=\"$sRootClass\">$sClass</b>::$iPKey ($sFriendlyname)<br/>\n";
|
||||||
foreach(MetaModel::ListAttributeDefs(get_class($this)) as $sAttCode=>$oAttDef)
|
return $sRet;
|
||||||
{
|
|
||||||
$sRet .= "<li>".$oAttDef->GetLabel()." = ".$this->GetAsHtml($sAttCode)."</li>\n";
|
|
||||||
}
|
|
||||||
$sRet .= "</ul>";
|
|
||||||
return $sRet;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Restore initial values... mmmm, to be discussed
|
// Restore initial values... mmmm, to be discussed
|
||||||
|
|||||||
Reference in New Issue
Block a user