src/ORM/Hierarchy/MarkedSet.php
public function getChildrenAsArray($serialiseEval = null)
    {
        if (!$serialiseEval) {
            $serialiseEval = function ($data) {
                /** @var DataObject $node */
                $node = $data['node'];
                return [
                    'id' => $node->ID,
                    'title' => $node->getTitle()
                ];
            };
        }

        $tree = $this->getSubtree($this->rootNode, 0);

        return $this->getSubtreeAsArray($tree, $serialiseEval);
    }
public function getChildrenAsArray($serialiseEval = null)
    {
        if (!$serialiseEval) {
            $serialiseEval = function ($data) {
                /** @var DataObject $node */
                $node = $data['node'];
                return [
                    'id' => $node->ID,
                    'title' => $node->getTitle()
                ];
            };
        }

        $tree = $this->getSubtree($this->rootNode, 0);

        return $this->getSubtreeAsArray($tree, $serialiseEval);
    }
public function getChildrenAsArray ( $ serialiseEval = null ) { if ( ! $ serialiseEval ) { $ serialiseEval = function ( $ data ) { /** @var DataObject $node */ $ node = $ data [ 'node' ] ; return [ 'id' => $ node -> ID , 'title' => $ node -> getTitle ( ) ] ; } ; } $ tree = $ this -> getSubtree ( $ this -> rootNode , 0 ) ; return $ this -> getSubtreeAsArray ( $ tree , $ serialiseEval ) ; }
Get child data formatted as JSON

@param callable $serialiseEval A callback that takes a DataObject as a single parameter,
and should return an array containing a simple array representation. This result will
replace the 'node' property at each point in the tree.
@return array
Get child data formatted as JSON