Skip to content

Commit 5f80a56

Browse files
committed
REFACTOR: Identifier -> Id across the codebase
1 parent 684ab43 commit 5f80a56

File tree

479 files changed

+7608
-7718
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

479 files changed

+7608
-7718
lines changed

Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/ProjectionIntegrityViolationDetectionTrait.php

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
use Neos\ContentGraph\DoctrineDbalAdapter\DoctrineDbalContentGraphProjectionFactory;
2020
use Neos\ContentGraph\DoctrineDbalAdapter\DoctrineDbalContentGraphSchemaBuilder;
2121
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint;
22-
use Neos\ContentRepository\Core\Factory\ContentRepositoryIdentifier;
23-
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamIdentifier;
24-
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateIdentifier;
25-
use Neos\ContentRepository\Core\Tests\Behavior\Features\Helper\TestingNodeAggregateIdentifier;
22+
use Neos\ContentRepository\Core\Factory\ContentRepositoryId;
23+
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
24+
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
25+
use Neos\ContentRepository\Core\Tests\Behavior\Features\Helper\TestingNodeAggregateId;
2626
use Neos\ContentRepositoryRegistry\Infrastructure\DbalClient;
2727
use Neos\Flow\Utility\Algorithms;
2828

@@ -33,11 +33,11 @@ trait ProjectionIntegrityViolationDetectionTrait
3333
{
3434
private DbalClient $dbalClient;
3535

36-
abstract protected function getContentRepositoryIdentifier(): ContentRepositoryIdentifier;
36+
abstract protected function getContentRepositoryId(): ContentRepositoryId;
3737

3838
protected function getTableNamePrefix(): string
3939
{
40-
return DoctrineDbalContentGraphProjectionFactory::graphProjectionTableNamePrefix($this->getContentRepositoryIdentifier());
40+
return DoctrineDbalContentGraphProjectionFactory::graphProjectionTableNamePrefix($this->getContentRepositoryId());
4141
}
4242

4343
public function setupDbalGraphAdapterIntegrityViolationTrait()
@@ -74,7 +74,7 @@ public function iDetachTheFollowingRestrictionRelationFromItsOrigin(TableNode $p
7474
$this->dbalClient->getConnection()->update(
7575
$this->getTableNamePrefix() . '_restrictionrelation',
7676
[
77-
'originnodeaggregateidentifier' => (string)TestingNodeAggregateIdentifier::nonExistent()
77+
'originnodeaggregateid' => (string)TestingNodeAggregateId::nonExistent()
7878
],
7979
$record
8080
);
@@ -92,7 +92,7 @@ public function iDetachTheFollowingRestrictionRelationFromItsTarget(TableNode $p
9292
$this->dbalClient->getConnection()->update(
9393
$this->getTableNamePrefix() . '_restrictionrelation',
9494
[
95-
'affectednodeaggregateidentifier' => (string)TestingNodeAggregateIdentifier::nonExistent()
95+
'affectednodeaggregateid' => (string)TestingNodeAggregateId::nonExistent()
9696
],
9797
$record
9898
);
@@ -143,7 +143,7 @@ public function iSetTheFollowingPosition(TableNode $payloadTable): void
143143
$dataset = $this->transformPayloadTableToDataset($payloadTable);
144144
$dimensionSpacePoint = DimensionSpacePoint::fromArray($dataset['dimensionSpacePoint']);
145145
$record = [
146-
'contentstreamidentifier' => $dataset['contentStreamIdentifier'],
146+
'contentstreamid' => $dataset['contentStreamId'],
147147
'dimensionspacepointhash' => $dimensionSpacePoint->hash,
148148
'childnodeanchor' => $this->findRelationAnchorPointByDataset($dataset)
149149
];
@@ -197,12 +197,12 @@ private function transformDatasetToReferenceRelationRecord(array $dataset): arra
197197
{
198198
return [
199199
'name' => $dataset['referenceName'],
200-
'nodeanchorpoint' => $this->findRelationAnchorPointByIdentifiers(
201-
ContentStreamIdentifier::fromString($dataset['contentStreamIdentifier']),
200+
'nodeanchorpoint' => $this->findRelationAnchorPointByIds(
201+
ContentStreamId::fromString($dataset['contentStreamId']),
202202
DimensionSpacePoint::fromArray($dataset['dimensionSpacePoint']),
203-
NodeAggregateIdentifier::fromString($dataset['sourceNodeAggregateIdentifier'])
203+
NodeAggregateId::fromString($dataset['sourceNodeAggregateId'])
204204
),
205-
'destinationnodeaggregateidentifier' => $dataset['destinationNodeAggregateIdentifier']
205+
'destinationnodeaggregateid' => $dataset['destinationNodeAggregateId']
206206
];
207207
}
208208

@@ -211,36 +211,36 @@ private function transformDatasetToRestrictionRelationRecord(array $dataset): ar
211211
$dimensionSpacePoint = DimensionSpacePoint::fromArray($dataset['dimensionSpacePoint']);
212212

213213
return [
214-
'contentstreamidentifier' => $dataset['contentStreamIdentifier'],
214+
'contentstreamid' => $dataset['contentStreamId'],
215215
'dimensionspacepointhash' => $dimensionSpacePoint->hash,
216-
'originnodeaggregateidentifier' => $dataset['originNodeAggregateIdentifier'],
217-
'affectednodeaggregateidentifier' => $dataset['affectedNodeAggregateIdentifier'],
216+
'originnodeaggregateid' => $dataset['originNodeAggregateId'],
217+
'affectednodeaggregateid' => $dataset['affectedNodeAggregateId'],
218218
];
219219
}
220220

221221
private function transformDatasetToHierarchyRelationRecord(array $dataset): array
222222
{
223223
$dimensionSpacePoint = DimensionSpacePoint::fromArray($dataset['dimensionSpacePoint']);
224-
$parentNodeAggregateIdentifier = TestingNodeAggregateIdentifier::fromString($dataset['parentNodeAggregateIdentifier']);
225-
$childAggregateIdentifier = TestingNodeAggregateIdentifier::fromString($dataset['childNodeAggregateIdentifier']);
224+
$parentNodeAggregateId = TestingNodeAggregateId::fromString($dataset['parentNodeAggregateId']);
225+
$childAggregateId = TestingNodeAggregateId::fromString($dataset['childNodeAggregateId']);
226226

227227
return [
228-
'contentstreamidentifier' => $dataset['contentStreamIdentifier'],
228+
'contentstreamid' => $dataset['contentStreamId'],
229229
'dimensionspacepoint' => \json_encode($dimensionSpacePoint),
230230
'dimensionspacepointhash' => $dimensionSpacePoint->hash,
231-
'parentnodeanchor' => $parentNodeAggregateIdentifier->isNonExistent()
231+
'parentnodeanchor' => $parentNodeAggregateId->isNonExistent()
232232
? Algorithms::generateUUID()
233-
: $this->findRelationAnchorPointByIdentifiers(
234-
ContentStreamIdentifier::fromString($dataset['contentStreamIdentifier']),
233+
: $this->findRelationAnchorPointByIds(
234+
ContentStreamId::fromString($dataset['contentStreamId']),
235235
$dimensionSpacePoint,
236-
NodeAggregateIdentifier::fromString($dataset['parentNodeAggregateIdentifier'])
236+
NodeAggregateId::fromString($dataset['parentNodeAggregateId'])
237237
),
238-
'childnodeanchor' => $childAggregateIdentifier->isNonExistent()
238+
'childnodeanchor' => $childAggregateId->isNonExistent()
239239
? Algorithms::generateUUID()
240-
: $this->findRelationAnchorPointByIdentifiers(
241-
ContentStreamIdentifier::fromString($dataset['contentStreamIdentifier']),
240+
: $this->findRelationAnchorPointByIds(
241+
ContentStreamId::fromString($dataset['contentStreamId']),
242242
$dimensionSpacePoint,
243-
NodeAggregateIdentifier::fromString($dataset['childNodeAggregateIdentifier'])
243+
NodeAggregateId::fromString($dataset['childNodeAggregateId'])
244244
),
245245
'position' => $dataset['position'] ?? 0
246246
];
@@ -250,30 +250,30 @@ private function findRelationAnchorPointByDataset(array $dataset): string
250250
{
251251
$dimensionSpacePoint = DimensionSpacePoint::fromArray($dataset['originDimensionSpacePoint'] ?? $dataset['dimensionSpacePoint']);
252252

253-
return $this->findRelationAnchorPointByIdentifiers(
254-
ContentStreamIdentifier::fromString($dataset['contentStreamIdentifier']),
253+
return $this->findRelationAnchorPointByIds(
254+
ContentStreamId::fromString($dataset['contentStreamId']),
255255
$dimensionSpacePoint,
256-
NodeAggregateIdentifier::fromString($dataset['nodeAggregateIdentifier'] ?? $dataset['childNodeAggregateIdentifier'])
256+
NodeAggregateId::fromString($dataset['nodeAggregateId'] ?? $dataset['childNodeAggregateId'])
257257
);
258258
}
259259

260-
private function findRelationAnchorPointByIdentifiers(
261-
ContentStreamIdentifier $contentStreamIdentifier,
260+
private function findRelationAnchorPointByIds(
261+
ContentStreamId $contentStreamId,
262262
DimensionSpacePoint $dimensionSpacePoint,
263-
NodeAggregateIdentifier $nodeAggregateIdentifier
263+
NodeAggregateId $nodeAggregateId
264264
): string {
265265
$nodeRecord = $this->dbalClient->getConnection()->executeQuery(
266266
'SELECT n.relationanchorpoint
267267
FROM ' . $this->getTableNamePrefix() . '_node n
268268
INNER JOIN ' . $this->getTableNamePrefix() . '_hierarchyrelation h
269269
ON n.relationanchorpoint = h.childnodeanchor
270-
WHERE n.nodeaggregateidentifier = :nodeAggregateIdentifier
271-
AND h.contentstreamidentifier = :contentStreamIdentifier
270+
WHERE n.nodeaggregateid = :nodeAggregateId
271+
AND h.contentstreamid = :contentStreamId
272272
AND h.dimensionspacepointhash = :dimensionSpacePointHash',
273273
[
274-
'contentStreamIdentifier' => (string)$contentStreamIdentifier,
274+
'contentStreamId' => (string)$contentStreamId,
275275
'dimensionSpacePointHash' => $dimensionSpacePoint->hash,
276-
'nodeAggregateIdentifier' => (string)$nodeAggregateIdentifier
276+
'nodeAggregateId' => (string)$nodeAggregateId
277277
]
278278
)->fetchAssociative();
279279

Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/NodesHaveAtMostOneParentPerSubgraph.feature

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -13,60 +13,60 @@ Feature: Run integrity violation detection regarding parent relations
1313
'Neos.ContentRepository.Testing:Document': []
1414
"""
1515
And the command CreateRootWorkspace is executed with payload:
16-
| Key | Value |
17-
| workspaceName | "live" |
18-
| workspaceTitle | "Live" |
19-
| workspaceDescription | "The live workspace" |
20-
| initiatingUserIdentifier | "00000000-0000-0000-0000-000000000000" |
21-
| newContentStreamIdentifier | "cs-identifier" |
16+
| Key | Value |
17+
| workspaceName | "live" |
18+
| workspaceTitle | "Live" |
19+
| workspaceDescription | "The live workspace" |
20+
| initiatingUserId | "00000000-0000-0000-0000-000000000000" |
21+
| newContentStreamId | "cs-identifier" |
2222
And the graph projection is fully up to date
2323
And the event RootNodeAggregateWithNodeWasCreated was published with payload:
2424
| Key | Value |
25-
| contentStreamIdentifier | "cs-identifier" |
26-
| nodeAggregateIdentifier | "lady-eleonode-rootford" |
25+
| contentStreamId | "cs-identifier" |
26+
| nodeAggregateId | "lady-eleonode-rootford" |
2727
| nodeTypeName | "Neos.ContentRepository:Root" |
2828
| coveredDimensionSpacePoints | [{"language":"de"},{"language":"gsw"},{"language":"fr"}] |
29-
| initiatingUserIdentifier | "00000000-0000-0000-0000-000000000000" |
29+
| initiatingUserId | "00000000-0000-0000-0000-000000000000" |
3030
| nodeAggregateClassification | "root" |
3131
And the event NodeAggregateWithNodeWasCreated was published with payload:
32-
| Key | Value |
33-
| contentStreamIdentifier | "cs-identifier" |
34-
| nodeAggregateIdentifier | "sir-david-nodenborough" |
35-
| nodeTypeName | "Neos.ContentRepository.Testing:Document" |
36-
| originDimensionSpacePoint | {"language":"de"} |
37-
| coveredDimensionSpacePoints | [{"language":"de"},{"language":"gsw"},{"language":"fr"}] |
38-
| parentNodeAggregateIdentifier | "lady-eleonode-rootford" |
39-
| nodeName | "document" |
40-
| nodeAggregateClassification | "regular" |
32+
| Key | Value |
33+
| contentStreamId | "cs-identifier" |
34+
| nodeAggregateId | "sir-david-nodenborough" |
35+
| nodeTypeName | "Neos.ContentRepository.Testing:Document" |
36+
| originDimensionSpacePoint | {"language":"de"} |
37+
| coveredDimensionSpacePoints | [{"language":"de"},{"language":"gsw"},{"language":"fr"}] |
38+
| parentnodeAggregateId | "lady-eleonode-rootford" |
39+
| nodeName | "document" |
40+
| nodeAggregateClassification | "regular" |
4141
And the event NodeAggregateWithNodeWasCreated was published with payload:
42-
| Key | Value |
43-
| contentStreamIdentifier | "cs-identifier" |
44-
| nodeAggregateIdentifier | "sir-nodeward-nodington-iii" |
45-
| nodeTypeName | "Neos.ContentRepository.Testing:Document" |
46-
| originDimensionSpacePoint | {"language":"de"} |
47-
| coveredDimensionSpacePoints | [{"language":"de"},{"language":"gsw"},{"language":"fr"}] |
48-
| parentNodeAggregateIdentifier | "lady-eleonode-rootford" |
49-
| nodeName | "esquire" |
50-
| nodeAggregateClassification | "regular" |
42+
| Key | Value |
43+
| contentStreamId | "cs-identifier" |
44+
| nodeAggregateId | "sir-nodeward-nodington-iii" |
45+
| nodeTypeName | "Neos.ContentRepository.Testing:Document" |
46+
| originDimensionSpacePoint | {"language":"de"} |
47+
| coveredDimensionSpacePoints | [{"language":"de"},{"language":"gsw"},{"language":"fr"}] |
48+
| parentnodeAggregateId | "lady-eleonode-rootford" |
49+
| nodeName | "esquire" |
50+
| nodeAggregateClassification | "regular" |
5151
And the event NodeAggregateWithNodeWasCreated was published with payload:
52-
| Key | Value |
53-
| contentStreamIdentifier | "cs-identifier" |
54-
| nodeAggregateIdentifier | "nody-mc-nodeface" |
55-
| nodeTypeName | "Neos.ContentRepository.Testing:Document" |
56-
| originDimensionSpacePoint | {"language":"de"} |
57-
| coveredDimensionSpacePoints | [{"language":"de"},{"language":"gsw"},{"language":"fr"}] |
58-
| parentNodeAggregateIdentifier | "sir-david-nodenborough" |
59-
| nodeName | "child-document" |
60-
| nodeAggregateClassification | "regular" |
52+
| Key | Value |
53+
| contentStreamId | "cs-identifier" |
54+
| nodeAggregateId | "nody-mc-nodeface" |
55+
| nodeTypeName | "Neos.ContentRepository.Testing:Document" |
56+
| originDimensionSpacePoint | {"language":"de"} |
57+
| coveredDimensionSpacePoints | [{"language":"de"},{"language":"gsw"},{"language":"fr"}] |
58+
| parentnodeAggregateId | "sir-david-nodenborough" |
59+
| nodeName | "child-document" |
60+
| nodeAggregateClassification | "regular" |
6161
And the graph projection is fully up to date
6262

6363
Scenario: Set a second parent for Nody McNodeface
6464
And I add the following hierarchy relation:
65-
| Key | Value |
66-
| contentStreamIdentifier | "cs-identifier" |
67-
| dimensionSpacePoint | {"language":"de"} |
68-
| parentNodeAggregateIdentifier | "sir-nodeward-nodington-iii" |
69-
| childNodeAggregateIdentifier | "nody-mc-nodeface" |
65+
| Key | Value |
66+
| contentStreamId | "cs-identifier" |
67+
| dimensionSpacePoint | {"language":"de"} |
68+
| parentnodeAggregateId | "sir-nodeward-nodington-iii" |
69+
| childnodeAggregateId | "nody-mc-nodeface" |
7070
And I run integrity violation detection
7171
Then I expect the integrity violation detection result to contain exactly 1 error
7272
And I expect integrity violation detection result error number 1 to have code 1597925698

0 commit comments

Comments
 (0)