Skip to content

Commit

Permalink
TASK: Adjust naming of NodeSerializer methods
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Feb 16, 2024
1 parent 74e864d commit 1bfdef1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Neos.ContentRepositoryRegistry/Classes/NodeSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ public function __construct(
) {
}

public function denormalizeNodeFromIdentity(NodeIdentity $identity): Node
public function findNodeByIdentity(NodeIdentity $identity): Node
{
$contentRepository = $this->contentRepositoryRegistry->get($identity->contentRepositoryId);
$workspace = $contentRepository->getWorkspaceFinder()->findOneByName($identity->workspaceName);
if (!$workspace) {
throw new \RuntimeException(sprintf('Workspace could not be found while deserializing node NodeIdentity<%s>.', json_encode($identity, JSON_PARTIAL_OUTPUT_ON_ERROR)), 1707757488);
throw new \RuntimeException(sprintf('Workspace could not be found while fetching NodeIdentity<%s>.', json_encode($identity, JSON_PARTIAL_OUTPUT_ON_ERROR)), 1707757488);
}
$subgraph = $contentRepository->getContentGraph()->getSubgraph(
$workspace->currentContentStreamId,
Expand All @@ -37,12 +37,12 @@ public function denormalizeNodeFromIdentity(NodeIdentity $identity): Node
);
$node = $subgraph->findNodeById($identity->nodeAggregateId);
if (!$node) {
throw new \RuntimeException(sprintf('NodeAggregateId could not be found while deserializing node NodeIdentity<%s>.', json_encode($identity, JSON_PARTIAL_OUTPUT_ON_ERROR)), 1707772263);
throw new \RuntimeException(sprintf('NodeAggregateId could not be found while fetching NodeIdentity<%s>.', json_encode($identity, JSON_PARTIAL_OUTPUT_ON_ERROR)), 1707772263);
}
return $node;
}

public function normalizeNodeToIdentity(Node $node): NodeIdentity
public function convertNodeToIdentity(Node $node): NodeIdentity
{
$contentRepository = $this->contentRepositoryRegistry->get($node->subgraphIdentity->contentRepositoryId);
$workspace = $contentRepository->getWorkspaceFinder()->findOneByCurrentContentStreamId($node->subgraphIdentity->contentStreamId);
Expand Down

0 comments on commit 1bfdef1

Please sign in to comment.