3 namespace Drupal\serialization\Normalizer;
6 * Normalizes/denormalizes Drupal content entities into an array structure.
8 class ContentEntityNormalizer extends EntityNormalizer {
13 protected $supportedInterfaceOrClass = ['Drupal\Core\Entity\ContentEntityInterface'];
18 public function normalize($object, $format = NULL, array $context = []) {
24 foreach ($object as $name => $field) {
25 if ($field->access('view', $context['account'])) {
26 $attributes[$name] = $this->serializer->normalize($field, $format, $context);