original_string: protected function init_columns($wanted, $heading = '') {
          $this->visiblecolumns = array();
          $this->extrarows = array();
          foreach ($wanted as $column) {
              if ($column->is_extra_row()) {
                  $this->extrarows[get_class($column)] = $column;
              } else {
                  $this->visiblecolumns[get_class($column)] = $column;
              }
          }
          if (array_key_exists($heading, $this->requiredcolumns)) {
              $this->requiredcolumns[$heading]->set_as_heading();
          }
      }
code: protected function init_columns($wanted, $heading = '') {
          $this->visiblecolumns = array();
          $this->extrarows = array();
          foreach ($wanted as $column) {
              if ($column->is_extra_row()) {
                  $this->extrarows[get_class($column)] = $column;
              } else {
                  $this->visiblecolumns[get_class($column)] = $column;
              }
          }
          if (array_key_exists($heading, $this->requiredcolumns)) {
              $this->requiredcolumns[$heading]->set_as_heading();
          }
      }
code_tokens: protected function init_columns ( $ wanted , $ heading = '' ) { $ this -> visiblecolumns = array ( ) ; $ this -> extrarows = array ( ) ; foreach ( $ wanted as $ column ) { if ( $ column -> is_extra_row ( ) ) { $ this -> extrarows [ get_class ( $ column ) ] = $ column ; } else { $ this -> visiblecolumns [ get_class ( $ column ) ] = $ column ; } } if ( array_key_exists ( $ heading , $ this -> requiredcolumns ) ) { $ this -> requiredcolumns [ $ heading ] -> set_as_heading ( ) ; } }
docstring: Initializing table columns
  
  @param array $wanted Collection of column names
  @param string $heading The name of column that is set as heading
docstring_tokens: Initializing table columns