code: func (r *Registry) getEntityParent(item mo.Entity, kind string) mo.Entity {
  	for {
  		parent := item.Entity().Parent
  
  		item = r.Get(*parent).(mo.Entity)
  
  		if item.Reference().Type == kind {
  			return item
  		}
  	}
  }
docs: // getEntityParent traverses up the inventory and returns the first object of type kind.
  // If no object of type kind is found, the method will panic when it reaches the
  // inventory root Folder where the Parent field is nil.