You are here

public function UserEntityNormalizer::normalize in Tome 8

Overrides ContentEntityNormalizer::normalize

File

modules/tome_sync/src/Normalizer/UserEntityNormalizer.php, line 20

Class

UserEntityNormalizer
Normalizes/denormalizes Drupal user entities into an array structure.

Namespace

Drupal\tome_sync\Normalizer

Code

public function normalize($entity, $format = NULL, array $context = []) {
  $values = parent::normalize($entity, $format, $context);
  $excluded_user_keys = [
    'access',
    'login',
    'init',
  ];
  $values = array_diff_key($values, array_flip($excluded_user_keys));
  return $values;
}