private function relationToArray(RelationOverride $relation)
    {
        if ($relation->type && !is_numeric($relation->type)) {
            $relation->type = constant(ClassMetadata::class . '::' . $relation->type);
        }

        return array_filter([
            'type' => $relation->type,
            'targetEntity' => $relation->targetEntity,
            'fieldName' => $relation->name,
            'inversedBy' => $relation->inversedBy,
            'mappedBy' => $relation->mappedBy,
            'fetch' => $relation->fetch,
            'cascade' => $relation->cascade,
            'orphanRemoval' => $relation->orphanRemoval,
        ]);
    }