Make serializer works with doctrine interfaces