Skip to content

Commit

Permalink
Merge pull request #5168 from mhsdesign/task/removeDeprecatedBeta10Apis
Browse files Browse the repository at this point in the history
TASK: Remove deprecated beta10 apis
  • Loading branch information
nezaniel authored Jul 29, 2024
2 parents 7c08e37 + 32c2a26 commit 3b50b6e
Show file tree
Hide file tree
Showing 31 changed files with 56 additions and 280 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ public function findNodeAggregateById(
return $this->nodeFactory->mapNodeRowsToNodeAggregate(
$this->fetchRows($queryBuilder),
$this->workspaceName,
$this->contentStreamId,
VisibilityConstraints::withoutRestrictions()
);
}
Expand Down Expand Up @@ -247,7 +246,6 @@ public function findParentNodeAggregateByChildOriginDimensionSpacePoint(NodeAggr
return $this->nodeFactory->mapNodeRowsToNodeAggregate(
$this->fetchRows($queryBuilder),
$this->workspaceName,
$this->contentStreamId,
VisibilityConstraints::withoutRestrictions()
);
}
Expand Down Expand Up @@ -334,7 +332,6 @@ private function mapQueryBuilderToNodeAggregate(QueryBuilder $queryBuilder): ?No
return $this->nodeFactory->mapNodeRowsToNodeAggregate(
$this->fetchRows($queryBuilder),
$this->workspaceName,
$this->contentStreamId,
VisibilityConstraints::withoutRestrictions()
);
}
Expand All @@ -348,7 +345,6 @@ private function mapQueryBuilderToNodeAggregates(QueryBuilder $queryBuilder): No
return $this->nodeFactory->mapNodeRowsToNodeAggregates(
$this->fetchRows($queryBuilder),
$this->workspaceName,
$this->contentStreamId,
VisibilityConstraints::withoutRestrictions()
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ public function findSubtree(NodeAggregateId $entryNodeAggregateId, FindSubtreeFi
$node = $this->nodeFactory->mapNodeRowToNode(
$nodeData,
$this->workspaceName,
$this->contentStreamId,
$this->dimensionSpacePoint,
$this->visibilityConstraints
);
Expand Down Expand Up @@ -333,7 +332,6 @@ public function findAncestorNodes(NodeAggregateId $entryNodeAggregateId, FindAnc
return $this->nodeFactory->mapNodeRowsToNodes(
$nodeRows,
$this->workspaceName,
$this->contentStreamId,
$this->dimensionSpacePoint,
$this->visibilityConstraints
);
Expand Down Expand Up @@ -387,7 +385,6 @@ public function findClosestNode(NodeAggregateId $entryNodeAggregateId, FindClose
return $this->nodeFactory->mapNodeRowsToNodes(
$nodeRows,
$this->workspaceName,
$this->contentStreamId,
$this->dimensionSpacePoint,
$this->visibilityConstraints
)->first();
Expand All @@ -407,7 +404,6 @@ public function findDescendantNodes(NodeAggregateId $entryNodeAggregateId, FindD
return $this->nodeFactory->mapNodeRowsToNodes(
$nodeRows,
$this->workspaceName,
$this->contentStreamId,
$this->dimensionSpacePoint,
$this->visibilityConstraints
);
Expand Down Expand Up @@ -679,7 +675,6 @@ private function fetchNode(QueryBuilder $queryBuilder): ?Node
return $this->nodeFactory->mapNodeRowToNode(
$nodeRow,
$this->workspaceName,
$this->contentStreamId,
$this->dimensionSpacePoint,
$this->visibilityConstraints
);
Expand All @@ -695,7 +690,6 @@ private function fetchNodes(QueryBuilder $queryBuilder): Nodes
return $this->nodeFactory->mapNodeRowsToNodes(
$nodeRows,
$this->workspaceName,
$this->contentStreamId,
$this->dimensionSpacePoint,
$this->visibilityConstraints
);
Expand All @@ -717,7 +711,12 @@ private function fetchReferences(QueryBuilder $queryBuilder): References
} catch (DBALException $e) {
throw new \RuntimeException(sprintf('Failed to fetch references: %s', $e->getMessage()), 1678364944, $e);
}
return $this->nodeFactory->mapReferenceRowsToReferences($referenceRows, $this->workspaceName, $this->contentStreamId, $this->dimensionSpacePoint, $this->visibilityConstraints);
return $this->nodeFactory->mapReferenceRowsToReferences(
$referenceRows,
$this->workspaceName,
$this->dimensionSpacePoint,
$this->visibilityConstraints
);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ public function __construct(
public function mapNodeRowToNode(
array $nodeRow,
WorkspaceName $workspaceName,
ContentStreamId $contentStreamId,
DimensionSpacePoint $dimensionSpacePoint,
VisibilityConstraints $visibilityConstraints
): Node {
Expand All @@ -85,8 +84,7 @@ public function mapNodeRowToNode(
isset($nodeRow['lastmodified']) ? self::parseDateTimeString($nodeRow['lastmodified']) : null,
isset($nodeRow['originallastmodified']) ? self::parseDateTimeString($nodeRow['originallastmodified']) : null,
),
$visibilityConstraints,
$contentStreamId
$visibilityConstraints
);
}

Expand All @@ -96,15 +94,13 @@ public function mapNodeRowToNode(
public function mapNodeRowsToNodes(
array $nodeRows,
WorkspaceName $workspaceName,
ContentStreamId $contentStreamId,
DimensionSpacePoint $dimensionSpacePoint,
VisibilityConstraints $visibilityConstraints
): Nodes {
return Nodes::fromArray(
array_map(fn (array $nodeRow) => $this->mapNodeRowToNode(
$nodeRow,
$workspaceName,
$contentStreamId,
$dimensionSpacePoint,
$visibilityConstraints
), $nodeRows)
Expand All @@ -125,7 +121,6 @@ public function createPropertyCollectionFromJsonString(string $jsonString): Prop
public function mapReferenceRowsToReferences(
array $nodeRows,
WorkspaceName $workspaceName,
ContentStreamId $contentStreamId,
DimensionSpacePoint $dimensionSpacePoint,
VisibilityConstraints $visibilityConstraints
): References {
Expand All @@ -134,7 +129,6 @@ public function mapReferenceRowsToReferences(
$node = $this->mapNodeRowToNode(
$nodeRow,
$workspaceName,
$contentStreamId,
$dimensionSpacePoint,
$visibilityConstraints
);
Expand All @@ -157,7 +151,6 @@ public function mapReferenceRowsToReferences(
public function mapNodeRowsToNodeAggregate(
array $nodeRows,
WorkspaceName $workspaceName,
ContentStreamId $contentStreamId,
VisibilityConstraints $visibilityConstraints
): ?NodeAggregate {
if (empty($nodeRows)) {
Expand All @@ -184,7 +177,6 @@ public function mapNodeRowsToNodeAggregate(
$nodesByOccupiedDimensionSpacePoint[$occupiedDimensionSpacePoint->hash] = $this->mapNodeRowToNode(
$nodeRow,
$workspaceName,
$contentStreamId,
$occupiedDimensionSpacePoint->toDimensionSpacePoint(),
$visibilityConstraints
);
Expand Down Expand Up @@ -230,7 +222,6 @@ public function mapNodeRowsToNodeAggregate(
$nodesByCoveredDimensionSpacePoints,
OriginByCoverage::fromArray($occupationByCovering),
$dimensionSpacePointsBySubtreeTags,
$contentStreamId,
);
}

Expand All @@ -241,7 +232,6 @@ public function mapNodeRowsToNodeAggregate(
public function mapNodeRowsToNodeAggregates(
array $nodeRows,
WorkspaceName $workspaceName,
ContentStreamId $contentStreamId,
VisibilityConstraints $visibilityConstraints
): NodeAggregates {
if (empty($nodeRows)) {
Expand Down Expand Up @@ -274,7 +264,6 @@ public function mapNodeRowsToNodeAggregates(
[$rawNodeAggregateId][$occupiedDimensionSpacePoint->hash] = $this->mapNodeRowToNode(
$nodeRow,
$workspaceName,
$contentStreamId,
$occupiedDimensionSpacePoint->toDimensionSpacePoint(),
$visibilityConstraints
);
Expand Down Expand Up @@ -338,7 +327,6 @@ public function mapNodeRowsToNodeAggregates(
$occupationByCoveringByNodeAggregate[$rawNodeAggregateId]
),
$dimensionSpacePointsBySubtreeTagsByNodeAggregate[$rawNodeAggregateId],
$contentStreamId,
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ public function __construct(
public function mapNodeRowToNode(
array $nodeRow,
VisibilityConstraints $visibilityConstraints,
?DimensionSpacePoint $dimensionSpacePoint = null,
?ContentStreamId $contentStreamId = null
?DimensionSpacePoint $dimensionSpacePoint = null
): Node {
return Node::create(
$this->contentRepositoryId,
Expand All @@ -92,7 +91,6 @@ public function mapNodeRowToNode(
isset($nodeRow['originallastmodified']) ? self::parseDateTimeString($nodeRow['originallastmodified']) : null,
),
$visibilityConstraints,
$contentStreamId ?: ContentStreamId::fromString($nodeRow['contentstreamid']),
);
}

Expand All @@ -101,16 +99,14 @@ public function mapNodeRowToNode(
*/
public function mapNodeRowsToNodes(
array $nodeRows,
VisibilityConstraints $visibilityConstraints,
ContentStreamId $contentStreamId = null
VisibilityConstraints $visibilityConstraints
): Nodes {
$nodes = [];
foreach ($nodeRows as $nodeRow) {
$nodes[] = $this->mapNodeRowToNode(
$nodeRow,
$visibilityConstraints,
null,
$contentStreamId
null
);
}

Expand All @@ -122,17 +118,15 @@ public function mapNodeRowsToNodes(
*/
public function mapReferenceRowsToReferences(
array $referenceRows,
VisibilityConstraints $visibilityConstraints,
ContentStreamId $contentStreamId = null
VisibilityConstraints $visibilityConstraints
): References {
$references = [];
foreach ($referenceRows as $referenceRow) {
$references[] = new Reference(
$this->mapNodeRowToNode(
$referenceRow,
$visibilityConstraints,
null,
$contentStreamId
null
),
ReferenceName::fromString($referenceRow['referencename']),
$referenceRow['referenceproperties']
Expand Down Expand Up @@ -205,8 +199,7 @@ public function mapNodeRowsToNodeAggregate(
$node = $this->mapNodeRowToNode(
$nodeRow,
$visibilityConstraints,
null,
$contentStreamId
null
);
$nodeAggregateId = $nodeAggregateId
?: NodeAggregateId::fromString($nodeRow['nodeaggregateid']);
Expand Down Expand Up @@ -247,7 +240,6 @@ public function mapNodeRowsToNodeAggregate(
OriginByCoverage::fromArray($occupationByCovered),
// TODO implement (see \Neos\ContentGraph\DoctrineDbalAdapter\Domain\Repository\NodeFactory::mapNodeRowsToNodeAggregate())
DimensionSpacePointsBySubtreeTags::create(),
$contentStreamId,
);
}

Expand Down Expand Up @@ -292,8 +284,7 @@ public function mapNodeRowsToNodeAggregates(array $nodeRows, VisibilityConstrain
$node = $this->mapNodeRowToNode(
$nodeRow,
$visibilityConstraints,
null,
$contentStreamId
null
);
$nodeAggregateIds[$key] = NodeAggregateId::fromString(
$nodeRow['nodeaggregateid']
Expand Down Expand Up @@ -346,7 +337,6 @@ public function mapNodeRowsToNodeAggregates(array $nodeRows, VisibilityConstrain
OriginByCoverage::fromArray($occupationByCovered[$key]),
// TODO implement (see \Neos\ContentGraph\DoctrineDbalAdapter\Domain\Repository\NodeFactory::mapNodeRowsToNodeAggregates())
DimensionSpacePointsBySubtreeTags::create(),
$contentStreamId,
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,12 @@
*
* This will no longer be required in the future see https://github.com/neos/neos-development-collection/pull/4988
*
* @deprecated this b/c layer will be removed with the next beta or before Neos 9 final release
* @api
* TODO decide whether it might be useful to have some return type that tells something about the published events
* (e.g. last sequence number) and maybe even about the updated/skipped projections
* see discussion: https://github.com/neos/neos-development-collection/pull/5061#issuecomment-2117643465
*
* @internal this object will either be transformed into something useful and made API or deleted.
*/
final readonly class CommandResult
{
/**
* We block by default thus you must not call this method or use this legacy stub
* @deprecated this b/c layer will be removed with the next beta or before Neos 9 final release
*/
public function block(): void
{
}
}
4 changes: 0 additions & 4 deletions Neos.ContentRepository.Core/Classes/ContentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,6 @@ public function __construct(
/**
* The only API to send commands (mutation intentions) to the system.
*
* The system is ASYNCHRONOUS by default, so that means the projection is not directly up to date. If you
* need to be synchronous, call {@see CommandResult::block()} on the returned CommandResult - then the system
* waits until the projections are up to date.
*
* @param CommandInterface $command
* @return CommandResult
*/
Expand Down
Loading

0 comments on commit 3b50b6e

Please sign in to comment.