-
-
Notifications
You must be signed in to change notification settings - Fork 221
/
NodeInterface.php
126 lines (111 loc) · 3.87 KB
/
NodeInterface.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
<?php
declare(strict_types=1);
namespace Neos\ContentRepository\Domain\Projection\Content;
/*
* 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.
*/
use Neos\ContentRepository\Domain\Model\NodeType;
use Neos\ContentRepository\Domain\ContentStream\ContentStreamIdentifier;
use Neos\ContentRepository\DimensionSpace\DimensionSpace\DimensionSpacePoint;
use Neos\ContentRepository\Domain\NodeAggregate\NodeAggregateIdentifier;
use Neos\ContentRepository\Domain\NodeAggregate\NodeName;
use Neos\ContentRepository\Domain\NodeType\NodeTypeName;
use Neos\Cache\CacheAwareInterface;
use Neos\EventSourcedContentRepository\Domain\Context\NodeAggregate\OriginDimensionSpacePoint;
/**
* This is a NEW interface, introduced in Neos 4.3.
*
* The new Event-Sourced core NodeInterface used for READING. It contains only information
* local to a node; i.e. all properties in this interface can be accessed extremely fast.
*
* Most likely, you want to use {@see TraversableNodeInterface} instead, as it is more
* convenient to use for end-users, as it also contains node traversal operations.
*
* The NodeInterface is *immutable*, meaning its contents never change after creation.
* It is *only used for reading*.
*
* Starting with version 5.0 (when backed by the Event Sourced CR), it is
* *completely detached from storage*; so it will not auto-update after a property changed in
* storage.
*/
interface NodeInterface extends CacheAwareInterface
{
/**
* Whether or not this node is the root of the graph, i.e. has no parent node
*
* @return bool
*/
public function isRoot(): bool;
/**
* Whether or not this node is tethered to its parent, fka auto created child node
*
* @return bool
*/
public function isTethered(): bool;
/**
* @return ContentStreamIdentifier
*/
public function getContentStreamIdentifier(): ContentStreamIdentifier;
/**
* @return NodeAggregateIdentifier
*/
public function getNodeAggregateIdentifier(): NodeAggregateIdentifier;
/**
* @return NodeTypeName
*/
public function getNodeTypeName(): NodeTypeName;
/**
* @return NodeType
*/
public function getNodeType(): NodeType;
/**
* @return NodeName|null
*/
public function getNodeName(): ?NodeName;
/**
* returns the DimensionSpacePoint the node is at home in. Usually needed to address a Node in a NodeAggregate
* in order to update it.
*
* @return OriginDimensionSpacePoint
*/
public function getOriginDimensionSpacePoint(): OriginDimensionSpacePoint;
/**
* Returns all properties of this node. References are NOT part of this API; there you need to check getReference() and getReferences()
*
* @return PropertyCollectionInterface Property values, indexed by their name
* @api
*/
public function getProperties(): PropertyCollectionInterface;
/**
* Returns the specified property.
*
* If the node has a content object attached, the property will be fetched
* there if it is gettable.
*
* @param string $propertyName Name of the property
* @return mixed value of the property
* @api
*/
public function getProperty($propertyName);
/**
* If this node has a property with the given name. Does NOT check the NodeType; but checks
* for a non-NULL property value.
*
* @param string $propertyName
* @return boolean
* @api
*/
public function hasProperty($propertyName): bool;
/**
* Returns the node label as generated by the configured node label generator
*
* @return string
*/
public function getLabel(): string;
}