You are here

class QuantityListBuilder in farmOS 2.x

Defines a class to build a listing of Quantity entities.

Hierarchy

Expanded class hierarchy of QuantityListBuilder

File

modules/core/quantity/src/QuantityListBuilder.php, line 13

Namespace

Drupal\quantity
View source
class QuantityListBuilder extends BulkFormEntityListBuilder {

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

  /**
   * {@inheritdoc}
   */
  public function buildRow(EntityInterface $entity) {

    /** @var \Drupal\quantity\Entity\QuantityInterface $entity */
    $row['id'] = [
      '#markup' => $entity
        ->id(),
    ];
    $row['name'] = $entity
      ->toLink($entity
      ->label(), 'canonical')
      ->toRenderable();
    return $row + parent::buildRow($entity);
  }

}

Members