public function getForWebserviceExport($document = null, $params = [])
{
$el = parent::getForWebserviceExport($document, $params);
if ($this->data["internal"]) {
if (intval($this->data["internalId"]) > 0) {
if ($this->data["internalType"] == "document") {
$referencedDocument = Document::getById($this->data["internalId"]);
if (!$referencedDocument instanceof Document) {
//detected broken link
$document = Document::getById($this->getDocumentId());
}
} elseif ($this->data["internalType"] == "asset") {
$referencedAsset = Asset::getById($this->data["internalId"]);
if (!$referencedAsset instanceof Asset) {
//detected broken link
$document = Document::getById($this->getDocumentId());
}
}
}
}
$el->data = $this->data;
return $el;
}