private function getTypeFromRegistry(string $type, bool $isEntityId): Type
    {
        if ($this->types->isEntity($type) && $isEntityId) {
            return $this->types->getId($type);
        }

        if ($this->types->isEntity($type) && !$isEntityId) {
            return $this->types->getOutput($type);
        }

        return $this->types->get($type);
    }