/** * {@inheritdoc} */ public function normalize(Log $log) { if (!$log instanceof TreeLog) { return []; } elseif (null === $log->getNode()) { throw new Exception('The log do not contains any node and wants to be serialized?'); } return array_merge(['_id' => $log->getId(), 'parent' => $log->getParentIdentifier(), 'status' => $log->getStatus()], $this->nodeNormalizer->normalize($log->getNode())); }
/** * {@inheritdoc} */ public function update(Node $node) { $this->log = $this->client->patch($this->log, $this->nodeNormalizer->normalize($node)); return $this; }