original_string: protected function updateHeader(CsvLine $csv_line, array $columns, $table_name)
  	{
  		$model_attributes = $csv_line->getAttributes();
  		$new_attributes = array();
  		foreach($columns as $key_column => $column)
  		{
  			if( isset($model_attributes[$key_column]) )
  			{
  				// append data to new attributes
  				$new_attributes = array_merge($new_attributes,array($column => $model_attributes[$key_column]));
  				unset($model_attributes[$key_column]);
  			}
  			else
  			{
  				throw new UnalignedArrayException;
  			}
  		}
  
  		// update data
  		$csv_line->resetAttributes();
  		foreach($new_attributes as $key_attribute => $attribute)
  		{
  			$csv_line->forceSetAttribute($key_attribute,$attribute);
  		}
  
  		$table = array("table" => $table_name);
  		$csv_line->setConfig( $table );
  
  		return true;
  	}
code: protected function updateHeader(CsvLine $csv_line, array $columns, $table_name)
  	{
  		$model_attributes = $csv_line->getAttributes();
  		$new_attributes = array();
  		foreach($columns as $key_column => $column)
  		{
  			if( isset($model_attributes[$key_column]) )
  			{
  				// append data to new attributes
  				$new_attributes = array_merge($new_attributes,array($column => $model_attributes[$key_column]));
  				unset($model_attributes[$key_column]);
  			}
  			else
  			{
  				throw new UnalignedArrayException;
  			}
  		}
  
  		// update data
  		$csv_line->resetAttributes();
  		foreach($new_attributes as $key_attribute => $attribute)
  		{
  			$csv_line->forceSetAttribute($key_attribute,$attribute);
  		}
  
  		$table = array("table" => $table_name);
  		$csv_line->setConfig( $table );
  
  		return true;
  	}
code_tokens: protected function updateHeader ( CsvLine $ csv_line , array $ columns , $ table_name ) { $ model_attributes = $ csv_line -> getAttributes ( ) ; $ new_attributes = array ( ) ; foreach ( $ columns as $ key_column => $ column ) { if ( isset ( $ model_attributes [ $ key_column ] ) ) { // append data to new attributes $ new_attributes = array_merge ( $ new_attributes , array ( $ column => $ model_attributes [ $ key_column ] ) ) ; unset ( $ model_attributes [ $ key_column ] ) ; } else { throw new UnalignedArrayException ; } } // update data $ csv_line -> resetAttributes ( ) ; foreach ( $ new_attributes as $ key_attribute => $ attribute ) { $ csv_line -> forceSetAttribute ( $ key_attribute , $ attribute ) ; } $ table = array ( "table" => $ table_name ) ; $ csv_line -> setConfig ( $ table ) ; return true ; }
docstring: Update headers of the csv_line
  
  @param CsvLine $csv_line
  @param Array $columns $key=column name, $value=column index
  @param Sring $table_name name of the table
  @return Boolean
  @throws UnalignedArrayException
docstring_tokens: Update headers of the csv_line