-
-
Notifications
You must be signed in to change notification settings - Fork 219
/
ContentGraphInterface.php
168 lines (150 loc) · 5.35 KB
/
ContentGraphInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<?php
/*
* This file is part of the Neos.ContentRepository package.
*
* (c) Contributors of the Neos Project - www.neos.io
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with this
* source code.
*/
declare(strict_types=1);
namespace Neos\ContentRepository\Core\Projection\ContentGraph;
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet;
use Neos\ContentRepository\Core\Projection\ProjectionStateInterface;
use Neos\ContentRepository\Core\Projection\ContentGraph\VisibilityConstraints;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint;
use Neos\ContentRepository\Core\SharedModel\Node\NodeName;
use Neos\ContentRepository\Core\NodeType\NodeTypeName;
use Neos\ContentRepository\Core\SharedModel\Exception\NodeAggregatesTypeIsAmbiguous;
use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint;
/**
* This is the MAIN ENTRY POINT for the Content Repository. This class exists only
* **once per Content Repository**.
*
* The most important API method is {@see ContentGraphInterface::getSubgraph()},
* where you can access the most important read model, the {@see ContentSubgraphInterface}.
*
* @api only the methods marked as API
*/
interface ContentGraphInterface extends ProjectionStateInterface
{
/**
* @api main API method of ContentGraph
*/
public function getSubgraph(
ContentStreamId $contentStreamId,
DimensionSpacePoint $dimensionSpacePoint,
VisibilityConstraints $visibilityConstraints
): ContentSubgraphInterface;
/**
* @api
* Throws exception if no root aggregate found, because a Content Repository needs at least
* one root node to function.
*
* Also throws exceptions if multiple root node aggregates of the given $nodeTypeName were found,
* as this would lead to nondeterministic results in your code.
*/
public function findRootNodeAggregateByType(
ContentStreamId $contentStreamId,
NodeTypeName $nodeTypeName
): NodeAggregate;
/**
* @api
*/
public function findRootNodeAggregates(
ContentStreamId $contentStreamId,
Filter\FindRootNodeAggregatesFilter $filter,
): NodeAggregates;
/**
* @return iterable<NodeAggregate>
* @api
*/
public function findNodeAggregatesByType(
ContentStreamId $contentStreamId,
NodeTypeName $nodeTypeName
): iterable;
/**
* @throws NodeAggregatesTypeIsAmbiguous
* @api
*/
public function findNodeAggregateById(
ContentStreamId $contentStreamId,
NodeAggregateId $nodeAggregateId
): ?NodeAggregate;
/**
* Returns all node types in use, from the graph projection
*
* @return iterable<NodeTypeName>
* @api
*/
public function findUsedNodeTypeNames(): iterable;
/**
* @internal
*/
public function findNodeByIdAndOriginDimensionSpacePoint(
ContentStreamId $contentStreamId,
NodeAggregateId $nodeAggregateId,
OriginDimensionSpacePoint $originDimensionSpacePoint
): ?Node;
/**
* @internal only for consumption inside the Command Handler
*/
public function findParentNodeAggregateByChildOriginDimensionSpacePoint(
ContentStreamId $contentStreamId,
NodeAggregateId $childNodeAggregateId,
OriginDimensionSpacePoint $childOriginDimensionSpacePoint
): ?NodeAggregate;
/**
* @return iterable<NodeAggregate>
* @internal only for consumption inside the Command Handler
*/
public function findParentNodeAggregates(
ContentStreamId $contentStreamId,
NodeAggregateId $childNodeAggregateId
): iterable;
/**
* @return iterable<NodeAggregate>
* @internal only for consumption inside the Command Handler
*/
public function findChildNodeAggregates(
ContentStreamId $contentStreamId,
NodeAggregateId $parentNodeAggregateId
): iterable;
/**
* A node aggregate may have multiple child node aggregates with the same name
* as long as they do not share dimension space coverage
*
* @return iterable<NodeAggregate>
* @internal only for consumption inside the Command Handler
*/
public function findChildNodeAggregatesByName(
ContentStreamId $contentStreamId,
NodeAggregateId $parentNodeAggregateId,
NodeName $name
): iterable;
/**
* @return iterable<NodeAggregate>
* @internal only for consumption inside the Command Handler
*/
public function findTetheredChildNodeAggregates(
ContentStreamId $contentStreamId,
NodeAggregateId $parentNodeAggregateId
): iterable;
/**
* @internal only for consumption inside the Command Handler
*/
public function getDimensionSpacePointsOccupiedByChildNodeName(
ContentStreamId $contentStreamId,
NodeName $nodeName,
NodeAggregateId $parentNodeAggregateId,
OriginDimensionSpacePoint $parentNodeOriginDimensionSpacePoint,
DimensionSpacePointSet $dimensionSpacePointsToCheck
): DimensionSpacePointSet;
/**
* @internal only for consumption in testcases
*/
public function countNodes(): int;
}