NULL, ]; $attributes = []; foreach ($object as $name => $field) { if ($field->access('view', $context['account'])) { $attributes[$name] = $this->serializer->normalize($field, $format, $context); } } return $attributes; } }