public function ReplicationLogNormalizer::normalize in Replication 8
Same name and namespace in other branches
- 8.2 src/Normalizer/ReplicationLogNormalizer.php \Drupal\replication\Normalizer\ReplicationLogNormalizer::normalize()
File
- src/
Normalizer/ ReplicationLogNormalizer.php, line 43
Class
Namespace
Drupal\replication\NormalizerCode
public function normalize($entity, $format = NULL, array $context = []) {
// Strictly format the entity how CouchDB expects it, plus our JSON-LD data.
$data = [
'@context' => [
'_id' => '@id',
],
'@type' => 'replication_log',
'_id' => '_local/' . $entity
->uuid(),
'_rev' => $entity->_rev->value,
'history' => $this->serializer
->normalize($entity
->get('history'), $format, $context),
'session_id' => $entity
->getSessionId(),
'source_last_seq' => $entity
->getSourceLastSeq(),
];
return $data;
}