-
Notifications
You must be signed in to change notification settings - Fork 8
Descendents at depth. #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/NestedSetInterface.php
Outdated
| * The nested array of descendants. | ||
| */ | ||
| public function findDescendants(NodeKey $nodeKey, $depth = 0); | ||
| public function findDescendants(NodeKey $nodeKey, $depth = 0, $start = 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but this defaults to 0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh it should be 1. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed the fix.
larowlan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me
|
|
||
| /** | ||
| * Loads the test data. | ||
| * |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
Without disturbing the existing $depth parameter, this provides an additional $start parameter. This is useful for those wanting to process a tree in layers (say building a visual representation), or if there is meaning to a specific layer, without doing a lot of php processing of the result set.
With the tree used in the tests, you can for example take 1 depth starting at depth 2.
Closes #23