mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX Allowing to pass $context into Hierarchy->markPartialTree() and Hierarchy->markChildren()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@69910 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
e25a15893e
commit
10cdb8e05c
@ -69,13 +69,13 @@ class Hierarchy extends DataObjectDecorator {
|
||||
* @param int $minCount The minimum amount of nodes to mark.
|
||||
* @return int The actual number of nodes marked.
|
||||
*/
|
||||
public function markPartialTree($minCount = 30) {
|
||||
public function markPartialTree($minCount = 30, $context = null) {
|
||||
$this->markedNodes = array($this->owner->ID => $this->owner);
|
||||
$this->owner->markUnexpanded();
|
||||
|
||||
// foreach can't handle an ever-growing $nodes list
|
||||
while(list($id, $node) = each($this->markedNodes)) {
|
||||
$this->markChildren($node);
|
||||
$this->markChildren($node, $context);
|
||||
|
||||
if($minCount && sizeof($this->markedNodes) >= $minCount) {
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user