public function getClosestOwner($object, $class)
    {
        if (!isset($object->owner)) {
            return;
        }

        if ($object->owner instanceof $class) {
            return $object->owner;
        }

        return $this->getClosestOwner($object->owner, $class);
    }