public function applyToChildNodes($parentId, Closure $callback)
	{
        $ids = $this->findChildNodeIds($parentId);

        // If there's at least one child id, then start working next
        if (!empty($ids)) {
            foreach ($ids as $id) {
                // Invoke a callback supplying a child's id
                $callback($id);
            }
        }

        return true;
    }
public function applyToChildNodes($parentId, Closure $callback)
	{
        $ids = $this->findChildNodeIds($parentId);

        // If there's at least one child id, then start working next
        if (!empty($ids)) {
            foreach ($ids as $id) {
                // Invoke a callback supplying a child's id
                $callback($id);
            }
        }

        return true;
    }
public function applyToChildNodes ( $ parentId , Closure $ callback ) { $ ids = $ this -> findChildNodeIds ( $ parentId ) ; // If there's at least one child id, then start working next if ( ! empty ( $ ids ) ) { foreach ( $ ids as $ id ) { // Invoke a callback supplying a child's id $ callback ( $ id ) ; } } return true ; }
Applies user-defined callback function to each node

@param string $parentId
@param \Closure $callback
Applies user - defined callback function to each node