phpcr-utils/src/PHPCR/Util/TreeWalker.php
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
\PHPCR\Util\TreeWalker
- Author
- Daniel Barsotti
Properties


\PHPCR\Util\array() $nodeFilters = array()
array()
Details- Type
- \PHPCR\Util\array()


\PHPCR\Util\array() $propertyFilters = array()
array()
Details- Type
- \PHPCR\Util\array()
Methods


__construct(\PHPCR\ItemVisitorInterface $nodeVisitor, \PHPCR\ItemVisitorInterface $propertyVisitor = null) : void
Instantiate a tree walker
Name | Type | Description |
---|---|---|
$nodeVisitor | \PHPCR\ItemVisitorInterface | The visitor for the nodes |
$propertyVisitor | \PHPCR\ItemVisitorInterface | The visitor for the nodes properties |


addNodeFilter(\PHPCR\Util\TreeWalkerFilterInterface $filter) : void
Add a filter to select the nodes that will be traversed
Name | Type | Description |
---|---|---|
$filter | \PHPCR\Util\TreeWalkerFilterInterface |


addPropertyFilter(\PHPCR\Util\TreeWalkerFilterInterface $filter) : void
Add a filter to select the properties that will be traversed
Name | Type | Description |
---|---|---|
$filter | \PHPCR\Util\TreeWalkerFilterInterface |


mustVisitNode(\PHPCR\NodeInterface $node) : boolean
Return whether a node must be traversed or not
Name | Type | Description |
---|---|---|
$node | \PHPCR\NodeInterface |
Type | Description |
---|---|
boolean |


mustVisitProperty(\PHPCR\PropertyInterface $property) : boolean
Return whether a node property must be traversed or not
Name | Type | Description |
---|---|---|
$property | \PHPCR\PropertyInterface |
Type | Description |
---|---|
boolean |


traverse(\PHPCR\NodeInterface $node, int $recurse = -1, int $level = 0) : void
Traverse a node
Name | Type | Description |
---|---|---|
$node | \PHPCR\NodeInterface | |
$recurse | int | Max recursion level |
$level | int | Recursion level |