/** * {@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 getParentIdentifier() { return null !== $this->parent ? $this->parent->getId() : null; }
/** * {@inheritdoc} */ public function archive(Log $log) { $url = sprintf('%s/v1/archive/%s', $this->baseUrl, $log->getId()); $response = $this->request('POST', $url); return $this->logNormalizer->denormalize($response); }