modules/acm_sku/src/Plugin/AcquiaCommerce/SKUType/Variant.php
public function buildAttributeRow($key, array $group = []) {
    $weight = isset($group['weight']) ? $group['weight'] : 0;
    $row = [];

    $row['enabled'] = [
      '#type' => 'checkbox',
      '#default_value' => isset($group['enabled']) ? $group['enabled'] : 0,
    ];

    $row['name'] = [
      '#plain_text' => $key,
    ];

    $row['label'] = [
      '#type' => 'textfield',
      '#default_value' => isset($group['label']) ? $group['label'] : '',
    ];

    $row['weight'] = [
      '#type' => 'weight',
      '#title' => t('Weight'),
      '#title_display' => 'invisible',
      '#default_value' => $weight,
      '#attributes' => ['class' => ['weight']],
    ];

    $row['#attributes']['class'][] = 'draggable';
    return $row;
  }
public function buildAttributeRow($key, array $group = []) {
    $weight = isset($group['weight']) ? $group['weight'] : 0;
    $row = [];

    $row['enabled'] = [
      '#type' => 'checkbox',
      '#default_value' => isset($group['enabled']) ? $group['enabled'] : 0,
    ];

    $row['name'] = [
      '#plain_text' => $key,
    ];

    $row['label'] = [
      '#type' => 'textfield',
      '#default_value' => isset($group['label']) ? $group['label'] : '',
    ];

    $row['weight'] = [
      '#type' => 'weight',
      '#title' => t('Weight'),
      '#title_display' => 'invisible',
      '#default_value' => $weight,
      '#attributes' => ['class' => ['weight']],
    ];

    $row['#attributes']['class'][] = 'draggable';
    return $row;
  }
public function buildAttributeRow ( $ key , array $ group = [ ] ) { $ weight = isset ( $ group [ 'weight' ] ) ? $ group [ 'weight' ] : 0 ; $ row = [ ] ; $ row [ 'enabled' ] = [ '#type' => 'checkbox' , '#default_value' => isset ( $ group [ 'enabled' ] ) ? $ group [ 'enabled' ] : 0 , ] ; $ row [ 'name' ] = [ '#plain_text' => $ key , ] ; $ row [ 'label' ] = [ '#type' => 'textfield' , '#default_value' => isset ( $ group [ 'label' ] ) ? $ group [ 'label' ] : '' , ] ; $ row [ 'weight' ] = [ '#type' => 'weight' , '#title' => t ( 'Weight' ) , '#title_display' => 'invisible' , '#default_value' => $ weight , '#attributes' => [ 'class' => [ 'weight' ] ] , ] ; $ row [ '#attributes' ] [ 'class' ] [ ] = 'draggable' ; return $ row ; }
Builds a row for the attributes form.

@param string $key
The attribute name/key.
@param array $group
The saved attribute values.

@return array
A table form row render array.
Builds a row for the attributes form .