public function setPath($path)
{
if (!empty($path)) {
if ($document = Document::getByPath($path)) {
$this->linktype = "internal";
$this->internalType = "document";
$this->internal = $document->getId();
} elseif ($asset = Asset::getByPath($path)) {
$this->linktype = "internal";
$this->internalType = "asset";
$this->internal = $asset->getId();
} else {
$this->linktype = "direct";
$this->direct = $path;
}
}
return $this;
}