1 | <?php |
||
20 | class DocumentInspector |
||
21 | { |
||
22 | /** |
||
23 | * @var DocumentRegistry |
||
24 | */ |
||
25 | protected $documentRegistry; |
||
26 | |||
27 | /** |
||
28 | * @var PathSegmentRegistry |
||
29 | */ |
||
30 | protected $pathSegmentRegistry; |
||
31 | |||
32 | /** |
||
33 | * @var ProxyFactory |
||
34 | */ |
||
35 | protected $proxyFactory; |
||
36 | |||
37 | /** |
||
38 | * @param DocumentRegistry $documentRegistry |
||
39 | * @param PathSegmentRegistry $pathSegmentRegistry |
||
40 | * @param ProxyFactory $proxyFactory |
||
41 | */ |
||
42 | public function __construct( |
||
51 | |||
52 | /** |
||
53 | * Return the parent document for the given document. |
||
54 | * |
||
55 | * @param object $document |
||
56 | * |
||
57 | * @return object|null |
||
58 | */ |
||
59 | public function getParent($document) |
||
69 | |||
70 | /** |
||
71 | * Get referrers for the document. |
||
72 | * |
||
73 | * @param object $document |
||
74 | * |
||
75 | * @return Collection\ReferrerCollection |
||
76 | */ |
||
77 | public function getReferrers($document) |
||
81 | |||
82 | /** |
||
83 | * Return the PHPCR node for the given document. |
||
84 | * |
||
85 | * @param object $document |
||
86 | * |
||
87 | * @return NodeInterface |
||
88 | */ |
||
89 | public function getNode($document) |
||
93 | |||
94 | /** |
||
95 | * Returns lazy-loading children collection for given document. |
||
96 | * |
||
97 | * @param object $document |
||
98 | * @param array $options |
||
99 | * |
||
100 | * @return Collection\ChildrenCollection |
||
101 | */ |
||
102 | public function getChildren($document, array $options = []) |
||
106 | |||
107 | /** |
||
108 | * Return true if the document has children. |
||
109 | * |
||
110 | * @param object $document |
||
111 | * |
||
112 | * @return bool |
||
113 | */ |
||
114 | public function hasChildren($document) |
||
118 | |||
119 | /** |
||
120 | * Return the locale for the given document. |
||
121 | * |
||
122 | * @param object $document |
||
123 | * |
||
124 | * @return string |
||
125 | */ |
||
126 | public function getLocale($document) |
||
130 | |||
131 | /** |
||
132 | * Return the original (requested) locale for the given document. |
||
133 | * |
||
134 | * @param object $document |
||
135 | * |
||
136 | * @return string |
||
137 | */ |
||
138 | public function getOriginalLocale($document) |
||
142 | |||
143 | /** |
||
144 | * Return the depth of the given document within the content repository. |
||
145 | * |
||
146 | * @param $document |
||
147 | * |
||
148 | * @return int |
||
149 | */ |
||
150 | public function getDepth($document) |
||
154 | |||
155 | /** |
||
156 | * Return the name of the document. |
||
157 | * |
||
158 | * @param $document |
||
159 | * |
||
160 | * @return string |
||
161 | */ |
||
162 | public function getName($document) |
||
166 | |||
167 | /** |
||
168 | * Return the path for the given document. |
||
169 | * |
||
170 | * @param object $document |
||
171 | * |
||
172 | * @return string |
||
173 | */ |
||
174 | public function getPath($document) |
||
180 | |||
181 | /** |
||
182 | * Return the UUID of the given document. |
||
183 | * |
||
184 | * @param object $document |
||
185 | * |
||
186 | * @return string |
||
187 | */ |
||
188 | public function getUuid($document) |
||
194 | } |
||
195 |