private function recurse_children($parent, &$options, $depth = 1) {
    $parent->childrens->map(function($child) use (&$options, $depth) {
      $options[$child->id] = str_repeat('-', $depth) .' '. $child->name;

      if ($child->childrens) {
        $this->recurse_children($child, $options, $depth+1);
      }
    });
  }
private function recurse_children($parent, &$options, $depth = 1) {
    $parent->childrens->map(function($child) use (&$options, $depth) {
      $options[$child->id] = str_repeat('-', $depth) .' '. $child->name;

      if ($child->childrens) {
        $this->recurse_children($child, $options, $depth+1);
      }
    });
  }
private function recurse_children ( $ parent , & $ options , $ depth = 1 ) { $ parent -> childrens -> map ( function ( $ child ) use ( & $ options , $ depth ) { $ options [ $ child -> id ] = str_repeat ( '-' , $ depth ) . ' ' . $ child -> name ; if ( $ child -> childrens ) { $ this -> recurse_children ( $ child , $ options , $ depth + 1 ) ; } } ) ; }
Recursively visit the children of a term and generate the '- ' option array for dropdowns

@param Object $parent
@param array  $options
@param int    $depth

@return array
Recursively visit the children of a term and generate the - option array for dropdowns