Make $object->fetchObjectLinked() ignore entity

Hi,
I am going insane. I just sank half a day in this problem.

I want to make the LinkedObjectBlock of a custom element type I created able to link to elements in all entities. We use multicompany. And I am willing to make customizations to the core files!

My problem is:

  1. The function showLinkedObjectBlock() calls $object->fetchObjectLinked();

  2. When I tried to analyze how function fetchObjectLinked() works I realized that at the end of the function all linked elements are in the result array ignoring entity

1.BUT the $object of my element type that has the linked objects “looses” the elements with non-fitting entities

  1. I can not find out where the linked objects are removed or even where the entity integer is evaluated when collecting the linked objects.

I hope someone can understand this description.

PLEASE HELP me