File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
Classes/NodeRendering/Extensibility/DocumentEnumerators Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -15,19 +15,29 @@ class LimitEnumerator implements DocumentEnumeratorInterface
1515 protected int $ i = 0 ;
1616 private ?int $ limit = null ;
1717 private ?string $ uriPathSegmentFilter = null ;
18+ private ?string $ nodePathSegmentFilter = null ;
1819
1920 public function __construct (
2021 array $ options = []
2122 ) {
2223 $ this ->limit = $ options ['limit ' ] ?? null ;
2324 $ this ->uriPathSegmentFilter = $ options ['uriPathSegmentFilter ' ] ?? null ;
25+ $ this ->nodePathSegmentFilter = $ options ['nodePathSegmentFilter ' ] ?? null ;
2426 }
2527 public function enumerateDocumentNode (NodeInterface $ documentNode ): iterable
2628 {
27- if ($ this ->uriPathSegmentFilter !== null ) {
28- if (str_contains ($ documentNode ->getProperty ('uriPathSegment ' ), $ this ->uriPathSegmentFilter ) === false ) {
29- return [];
30- }
29+ if (
30+ $ this ->uriPathSegmentFilter !== null
31+ && str_contains ($ documentNode ->getProperty ('uriPathSegment ' ), $ this ->uriPathSegmentFilter ) === false
32+ ) {
33+ return [];
34+ }
35+
36+ if (
37+ $ this ->nodePathSegmentFilter !== null
38+ && str_contains ($ documentNode ->getPath (), $ this ->nodePathSegmentFilter ) === false
39+ ) {
40+ return [];
3141 }
3242
3343 // NOTE: Limiting must come LAST, after all other constraints have been evaluated (because we want
You can’t perform that action at this time.
0 commit comments