public static function getTypePath($element)
{
$path = "";
if ($element instanceof ElementInterface) {
$elementType = self::getElementType($element);
$nid = $element->getParentId();
$ne = self::getElementById($elementType, $nid);
}
if ($ne) {
$path = self::getTypePath($ne, $path);
}
if ($element) {
$type = $element->getType();
if ($type != "folder") {
if ($element instanceof Document) {
$type = "document";
} elseif ($element instanceof Object\AbstractObject) {
$type = "object";
} elseif ($element instanceof Asset) {
$type = "asset";
} else {
throw new \Exception("unknown type");
}
}
$path = $path . "/" . $type;
}
return $path;
}