public function getDiffVersionPreview($data, $object = null, $params = [])
{
$html = "";
if ($data instanceof Object\Fieldcollection) {
$html = "<table>";
foreach ($data as $item) {
if (!$item instanceof Object\Fieldcollection\Data\AbstractData) {
continue;
}
$type = $item->getType();
$html .= "<tr><th><b>" . $type . "</b></th><th> </th><th> </th></tr>";
try {
$collectionDef = Object\Fieldcollection\Definition::getByKey($item->getType());
} catch (\Exception $e) {
continue;
}
$collectionData = [];
foreach ($collectionDef->getFieldDefinitions() as $fd) {
$title = !empty($fd->title) ? $fd->title : $fd->getName();
$html .= "<tr><td> </td><td>" . $title . "</td><td>";
$html .= $fd->getVersionPreview($item->{$fd->getName()}, $object, $params);
$html .= "</td></tr>";
}
}
$html .= "</table>";
}
$value = [];
$value["html"] = $html;
$value["type"] = "html";
return $value;
}