original_string: protected function buildSelectOptions(array $nodes = [], $parentId = 0, $prefix = '')
      {
          $prefix = $prefix ?: str_repeat('&nbsp;', 6);
  
          $options = [];
  
          if (empty($nodes)) {
              $nodes = $this->allNodes();
          }
  
          foreach ($nodes as $node) {
              $node[$this->titleColumn] = $prefix.'&nbsp;'.$node[$this->titleColumn];
              if ($node[$this->parentColumn] == $parentId) {
                  $children = $this->buildSelectOptions($nodes, $node[$this->getKeyName()], $prefix.$prefix);
  
                  $options[$node[$this->getKeyName()]] = $node[$this->titleColumn];
  
                  if ($children) {
                      $options += $children;
                  }
              }
          }
  
          return $options;
      }
code: protected function buildSelectOptions(array $nodes = [], $parentId = 0, $prefix = '')
      {
          $prefix = $prefix ?: str_repeat('&nbsp;', 6);
  
          $options = [];
  
          if (empty($nodes)) {
              $nodes = $this->allNodes();
          }
  
          foreach ($nodes as $node) {
              $node[$this->titleColumn] = $prefix.'&nbsp;'.$node[$this->titleColumn];
              if ($node[$this->parentColumn] == $parentId) {
                  $children = $this->buildSelectOptions($nodes, $node[$this->getKeyName()], $prefix.$prefix);
  
                  $options[$node[$this->getKeyName()]] = $node[$this->titleColumn];
  
                  if ($children) {
                      $options += $children;
                  }
              }
          }
  
          return $options;
      }
code_tokens: protected function buildSelectOptions ( array $ nodes = [ ] , $ parentId = 0 , $ prefix = '' ) { $ prefix = $ prefix ? : str_repeat ( '&nbsp;' , 6 ) ; $ options = [ ] ; if ( empty ( $ nodes ) ) { $ nodes = $ this -> allNodes ( ) ; } foreach ( $ nodes as $ node ) { $ node [ $ this -> titleColumn ] = $ prefix . '&nbsp;' . $ node [ $ this -> titleColumn ] ; if ( $ node [ $ this -> parentColumn ] == $ parentId ) { $ children = $ this -> buildSelectOptions ( $ nodes , $ node [ $ this -> getKeyName ( ) ] , $ prefix . $ prefix ) ; $ options [ $ node [ $ this -> getKeyName ( ) ] ] = $ node [ $ this -> titleColumn ] ; if ( $ children ) { $ options += $ children ; } } } return $ options ; }
docstring: Build options of select field in form.
  
  @param array  $nodes
  @param int    $parentId
  @param string $prefix
  
  @return array
docstring_tokens: Build options of select field in form .