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