Skip to content

Commit

Permalink
TASK: Replace $node->subgraphIdentity->* with $node->*
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed May 18, 2024
1 parent 8f18250 commit bf4df1e
Show file tree
Hide file tree
Showing 18 changed files with 34 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function evaluate(FlowQuery $flowQuery, array $arguments): mixed
return ObjectAccess::getPropertyPath($element, substr($propertyName, 1));
}

$contentRepository = $this->contentRepositoryRegistry->get($element->subgraphIdentity->contentRepositoryId);
$contentRepository = $this->contentRepositoryRegistry->get($element->contentRepositoryId);
$nodeTypeManager = $contentRepository->getNodeTypeManager();

if ($nodeTypeManager->getNodeType($element->nodeTypeName)?->hasReference($propertyName)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ public function rebaseAndRedirectAction(Node $targetNode, Workspace $targetWorks

$targetNodeAddressInPersonalWorkspace = new NodeAddress(
$personalWorkspace->currentContentStreamId,
$targetNode->subgraphIdentity->dimensionSpacePoint,
$targetNode->dimensionSpacePoint,
$targetNode->nodeAggregateId,
$personalWorkspace->workspaceName
);
Expand Down Expand Up @@ -874,7 +874,7 @@ protected function getOriginalNode(
ContentRepository $contentRepository,
): ?Node {
$baseSubgraph = $contentRepository->getContentGraph($baseWorkspaceName)->getSubgraph(
$modifiedNode->subgraphIdentity->dimensionSpacePoint,
$modifiedNode->dimensionSpacePoint,
VisibilityConstraints::withoutRestrictions()
);
return $baseSubgraph->findNodeById($modifiedNode->nodeAggregateId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ private function __construct(
public static function fromNode(Node $node): self
{
return new self('Node_' . $node->subgraphIdentity->contentStreamId->value
. '_' . $node->subgraphIdentity->dimensionSpacePoint->hash
. '_' . $node->dimensionSpacePoint->hash
. '_' . $node->nodeAggregateId->value);
}

Expand Down
2 changes: 1 addition & 1 deletion Neos.Neos/Classes/FrontendRouting/NodeAddressFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function createFromNode(Node $node): NodeAddress
{
return $this->createFromContentStreamIdAndDimensionSpacePointAndNodeAggregateId(
$node->subgraphIdentity->contentStreamId,
$node->subgraphIdentity->dimensionSpacePoint,
$node->dimensionSpacePoint,
$node->nodeAggregateId,
);
}
Expand Down
16 changes: 8 additions & 8 deletions Neos.Neos/Classes/Fusion/DimensionsMenuItemsImplementation.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected function buildItems(): array
$menuItems = [];
$currentNode = $this->getCurrentNode();

$contentRepositoryId = $currentNode->subgraphIdentity->contentRepositoryId;
$contentRepositoryId = $currentNode->contentRepositoryId;
$contentRepository = $this->contentRepositoryRegistry->get(
$contentRepositoryId,
);
Expand All @@ -63,7 +63,7 @@ protected function buildItems(): array
assert($dimensionMenuItemsImplementationInternals instanceof DimensionsMenuItemsImplementationInternals);

$interDimensionalVariationGraph = $dimensionMenuItemsImplementationInternals->interDimensionalVariationGraph;
$currentDimensionSpacePoint = $currentNode->subgraphIdentity->dimensionSpacePoint;
$currentDimensionSpacePoint = $currentNode->dimensionSpacePoint;
$contentDimensionIdentifierToLimitTo = $this->getContentDimensionIdentifierToLimitTo();
try {
$contentGraph = $contentRepository->getContentGraph($currentNode->workspaceName);
Expand All @@ -80,7 +80,7 @@ protected function buildItems(): array
$variant = $contentGraph
->getSubgraph(
$dimensionSpacePoint,
$currentNode->subgraphIdentity->visibilityConstraints,
$currentNode->visibilityConstraints,
)
->findNodeById($currentNode->nodeAggregateId);
}
Expand Down Expand Up @@ -119,9 +119,9 @@ protected function buildItems(): array
$order,
$contentDimensionIdentifierToLimitTo
) {
return (int)$order[$menuItemA->node?->subgraphIdentity->dimensionSpacePoint->getCoordinate(
return (int)$order[$menuItemA->node?->dimensionSpacePoint->getCoordinate(
$contentDimensionIdentifierToLimitTo
)] <=> (int)$order[$menuItemB->node?->subgraphIdentity->dimensionSpacePoint->getCoordinate(
)] <=> (int)$order[$menuItemB->node?->dimensionSpacePoint->getCoordinate(
$contentDimensionIdentifierToLimitTo
)];
});
Expand All @@ -138,11 +138,11 @@ protected function isDimensionSpacePointRelevant(DimensionSpacePoint $dimensionS
{
return !$this->getContentDimensionIdentifierToLimitTo() // no limit to one dimension, so all DSPs are relevant
// always include the current variant
|| $dimensionSpacePoint->equals($this->currentNode->subgraphIdentity->dimensionSpacePoint)
|| $dimensionSpacePoint->equals($this->currentNode->dimensionSpacePoint)
// include all direct variants in the dimension we're limited to unless their values
// in that dimension are missing in the specified list
|| $dimensionSpacePoint->isDirectVariantInDimension(
$this->currentNode->subgraphIdentity->dimensionSpacePoint,
$this->currentNode->dimensionSpacePoint,
$this->getContentDimensionIdentifierToLimitTo()
)
&& (
Expand Down Expand Up @@ -172,7 +172,7 @@ protected function findClosestGeneralizationMatchingDimensionValue(
$variant = $contentGraph
->getSubgraph(
$generalization,
$this->getCurrentNode()->subgraphIdentity->visibilityConstraints,
$this->getCurrentNode()->visibilityConstraints,
)
->findNodeById($nodeAggregateId);
if ($variant) {
Expand Down
6 changes: 3 additions & 3 deletions Neos.Neos/Classes/Fusion/Helper/DimensionHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ final class DimensionHelper implements ProtectedContextAwareInterface
public function currentValue(Node $node, ContentDimensionId|string $dimensionName): ?ContentDimensionValue
{
$contentDimensionId = is_string($dimensionName) ? new ContentDimensionId($dimensionName) : $dimensionName;
$currentDimensionValueAsString = $node->subgraphIdentity->dimensionSpacePoint->getCoordinate($contentDimensionId);
$currentDimensionValueAsString = $node->dimensionSpacePoint->getCoordinate($contentDimensionId);

if (is_string($currentDimensionValueAsString)) {
return $this->allDimensionValues($node, $contentDimensionId)?->getValue($currentDimensionValueAsString);
Expand Down Expand Up @@ -97,7 +97,7 @@ public function originValue(Node $node, ContentDimensionId|string $dimensionName
*/
public function all(ContentRepositoryId|Node $subject): array
{
$contentRepositoryId = $subject instanceof Node ? $subject->subgraphIdentity->contentRepositoryId : $subject;
$contentRepositoryId = $subject instanceof Node ? $subject->contentRepositoryId : $subject;
$contentRepository = $this->contentRepositoryRegistry->get($contentRepositoryId);

return $contentRepository->getContentDimensionSource()->getContentDimensionsOrderedByPriority();
Expand All @@ -118,7 +118,7 @@ public function all(ContentRepositoryId|Node $subject): array
*/
public function allDimensionValues(ContentRepositoryId|Node $subject, ContentDimensionId|string $dimensionName): ?ContentDimensionValues
{
$contentRepositoryId = $subject instanceof Node ? $subject->subgraphIdentity->contentRepositoryId : $subject;
$contentRepositoryId = $subject instanceof Node ? $subject->contentRepositoryId : $subject;
$contentDimensionId = is_string($dimensionName) ? new ContentDimensionId($dimensionName) : $dimensionName;

$contentRepository = $this->contentRepositoryRegistry->get($contentRepositoryId);
Expand Down
2 changes: 1 addition & 1 deletion Neos.Neos/Classes/Fusion/Helper/LinkHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function resolveNodeUri(
return null;
}
$contentRepository = $this->contentRepositoryRegistry->get(
$targetNode->subgraphIdentity->contentRepositoryId
$targetNode->contentRepositoryId
);
$targetNodeAddress = NodeAddressFactory::create($contentRepository)->createFromNode($targetNode);
try {
Expand Down
4 changes: 2 additions & 2 deletions Neos.Neos/Classes/Fusion/Helper/NodeHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,14 @@ public function getNodeType(Node $node): NodeType

public function isNodeTypeExistent(Node $node): bool
{
$contentRepository = $this->contentRepositoryRegistry->get($node->subgraphIdentity->contentRepositoryId);
$contentRepository = $this->contentRepositoryRegistry->get($node->contentRepositoryId);
return $contentRepository->getNodeTypeManager()->hasNodeType($node->nodeTypeName);
}

public function serializedNodeAddress(Node $node): string
{
$contentRepository = $this->contentRepositoryRegistry->get(
$node->subgraphIdentity->contentRepositoryId
$node->contentRepositoryId
);
$nodeAddressFactory = NodeAddressFactory::create($contentRepository);
return $nodeAddressFactory->createFromNode($node)->serializeForUri();
Expand Down
2 changes: 1 addition & 1 deletion Neos.Neos/Classes/Fusion/NodeUriImplementation.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public function evaluate()
$node = $this->getNode();
if ($node instanceof Node) {
$contentRepository = $this->contentRepositoryRegistry->get(
$node->subgraphIdentity->contentRepositoryId
$node->contentRepositoryId
);
$nodeAddressFactory = NodeAddressFactory::create($contentRepository);
$nodeAddress = $nodeAddressFactory->createFromNode($node);
Expand Down
2 changes: 1 addition & 1 deletion Neos.Neos/Classes/Routing/NodeIdentityConverterAspect.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function convertNodeToContextPathForRouting(JoinPointInterface $joinPoint
$objectArgument = $joinPoint->getMethodArgument('object');
if ($objectArgument instanceof Node) {
$contentRepository = $this->contentRepositoryRegistry->get(
$objectArgument->subgraphIdentity->contentRepositoryId
$objectArgument->contentRepositoryId
);
$nodeAddressFactory = NodeAddressFactory::create($contentRepository);
$nodeAddress = $nodeAddressFactory->createFromNode($objectArgument);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ContentElementEditableService
public function wrapContentProperty(Node $node, string $property, string $content): string
{
$contentRepository = $this->contentRepositoryRegistry->get(
$node->subgraphIdentity->contentRepositoryId
$node->contentRepositoryId
);

// TODO: permissions
Expand Down
4 changes: 2 additions & 2 deletions Neos.Neos/Classes/Service/ContentElementWrappingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function wrapContentObject(
array $additionalAttributes = []
): ?string {
$contentRepository = $this->contentRepositoryRegistry->get(
$node->subgraphIdentity->contentRepositoryId
$node->contentRepositoryId
);

// TODO: reenable permissions
Expand Down Expand Up @@ -121,7 +121,7 @@ public function wrapContentObject(
protected function addCssClasses(array $attributes, Node $node, array $initialClasses = []): array
{
$classNames = $initialClasses;
if (!$node->subgraphIdentity->dimensionSpacePoint->equals($node->originDimensionSpacePoint)) {
if (!$node->dimensionSpacePoint->equals($node->originDimensionSpacePoint)) {
$classNames[] = 'neos-contentelement-shine-through';
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function convertFrom(
PropertyMappingConfigurationInterface $configuration = null
) {
$contentRepository = $this->contentRepositoryRegistry->get(
$source->subgraphIdentity->contentRepositoryId
$source->contentRepositoryId
);
return NodeAddressFactory::create($contentRepository)->createFromNode($source)->serializeForUri();
}
Expand Down
2 changes: 1 addition & 1 deletion Neos.Neos/Classes/Utility/NodeTypeWithFallbackProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ trait NodeTypeWithFallbackProvider
{
protected function getNodeType(Node $node): NodeType
{
$nodeTypeManager = $this->contentRepositoryRegistry->get($node->subgraphIdentity->contentRepositoryId)->getNodeTypeManager();
$nodeTypeManager = $this->contentRepositoryRegistry->get($node->contentRepositoryId)->getNodeTypeManager();

return $nodeTypeManager->getNodeType($node->nodeTypeName)
?? $nodeTypeManager->getNodeType(NodeTypeNameFactory::forFallback())
Expand Down
2 changes: 1 addition & 1 deletion Neos.Neos/Classes/View/FusionView.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function render(): ResponseInterface|StreamInterface

$fusionRuntime = $this->getFusionRuntime($currentSiteNode);

$this->setFallbackRuleFromDimension($currentNode->subgraphIdentity->dimensionSpacePoint);
$this->setFallbackRuleFromDimension($currentNode->dimensionSpacePoint);

return $fusionRuntime->renderEntryPathWithContext($this->fusionPath, [
'node' => $currentNode,
Expand Down
6 changes: 3 additions & 3 deletions Neos.Neos/Classes/ViewHelpers/Link/NodeViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,15 +263,15 @@ public function render(): string

if ($node instanceof Node) {
$contentRepository = $this->contentRepositoryRegistry->get(
$node->subgraphIdentity->contentRepositoryId
$node->contentRepositoryId
);
$nodeAddressFactory = NodeAddressFactory::create($contentRepository);
$nodeAddress = $nodeAddressFactory->createFromNode($node);
} elseif (is_string($node)) {
$documentNode = $this->getContextVariable('documentNode');
assert($documentNode instanceof Node);
$contentRepository = $this->contentRepositoryRegistry->get(
$documentNode->subgraphIdentity->contentRepositoryId
$documentNode->contentRepositoryId
);
$nodeAddress = $this->resolveNodeAddressFromString($node, $documentNode, $contentRepository);
$node = $documentNode;
Expand All @@ -287,7 +287,7 @@ public function render(): string
$subgraph = $contentRepository->getContentGraph($nodeAddress->workspaceName)
->getSubgraph(
$nodeAddress->dimensionSpacePoint,
$node->subgraphIdentity->visibilityConstraints
$node->visibilityConstraints
);

$resolvedNode = $subgraph->findNodeById($nodeAddress->nodeAggregateId);
Expand Down
4 changes: 2 additions & 2 deletions Neos.Neos/Classes/ViewHelpers/Uri/NodeViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public function render(): string

if ($node instanceof Node) {
$contentRepository = $this->contentRepositoryRegistry->get(
$node->subgraphIdentity->contentRepositoryId
$node->contentRepositoryId
);
$nodeAddressFactory = NodeAddressFactory::create($contentRepository);
$nodeAddress = $nodeAddressFactory->createFromNode($node);
Expand Down Expand Up @@ -264,7 +264,7 @@ private function resolveNodeAddressFromString(string $path): ?NodeAddress
/* @var Node $documentNode */
$documentNode = $this->getContextVariable('documentNode');
$contentRepository = $this->contentRepositoryRegistry->get(
$documentNode->subgraphIdentity->contentRepositoryId
$documentNode->contentRepositoryId
);
$nodeAddressFactory = NodeAddressFactory::create($contentRepository);
$documentNodeAddress = $nodeAddressFactory->createFromNode($documentNode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function handleExceededNodeDates(ContentRepositoryId $contentRepositoryId
EnableNodeAggregate::create(
$workspaceName,
$node->nodeAggregateId,
$node->subgraphIdentity->dimensionSpacePoint,
$node->dimensionSpacePoint,
NodeVariantSelectionStrategy::STRATEGY_ALL_SPECIALIZATIONS
)
);
Expand All @@ -69,7 +69,7 @@ public function handleExceededNodeDates(ContentRepositoryId $contentRepositoryId
DisableNodeAggregate::create(
$workspaceName,
$node->nodeAggregateId,
$node->subgraphIdentity->dimensionSpacePoint,
$node->dimensionSpacePoint,
NodeVariantSelectionStrategy::STRATEGY_ALL_SPECIALIZATIONS
)
);
Expand Down

0 comments on commit bf4df1e

Please sign in to comment.