You are here

ProductAttributeListBuilder.php in Commerce Core 8.2

File

modules/product/src/ProductAttributeListBuilder.php
View source
<?php

namespace Drupal\commerce_product;

use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
use Drupal\Core\Entity\EntityInterface;

/**
 * Defines the list builder for product attributes.
 */
class ProductAttributeListBuilder extends ConfigEntityListBuilder {

  /**
   * {@inheritdoc}
   */
  public function buildHeader() {
    $header['label'] = $this
      ->t('Attribute name');
    $header['id'] = $this
      ->t('ID');
    return $header + parent::buildHeader();
  }

  /**
   * {@inheritdoc}
   */
  public function buildRow(EntityInterface $entity) {
    $row['label'] = $entity
      ->label();
    $row['id'] = $entity
      ->id();
    return $row + parent::buildRow($entity);
  }

}

Classes

Namesort descending Description
ProductAttributeListBuilder Defines the list builder for product attributes.