ConfigTestListBuilder.php

Same filename and directory in other branches
  1. 9 core/modules/config/tests/config_test/src/ConfigTestListBuilder.php
  2. 8.9.x core/modules/config/tests/config_test/src/ConfigTestListBuilder.php
  3. 10 core/modules/config/tests/config_test/src/ConfigTestListBuilder.php

Namespace

Drupal\config_test

File

core/modules/config/tests/config_test/src/ConfigTestListBuilder.php

View source
<?php

namespace Drupal\config_test;

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

/**
 * Defines a class to build a listing of ConfigTest entities.
 *
 * @see \Drupal\config_test\Entity\ConfigTest
 */
class ConfigTestListBuilder extends ConfigEntityListBuilder {
    
    /**
     * {@inheritdoc}
     */
    public function buildHeader() {
        $header['label'] = t('Label');
        $header['id'] = t('Machine name');
        return $header + parent::buildHeader();
    }
    
    /**
     * {@inheritdoc}
     */
    public function buildRow(EntityInterface $entity) {
        $row['label'] = $entity->label();
        $row['id'] = $entity->id();
        return $row + parent::buildRow($entity);
    }

}

Classes

Title Deprecated Summary
ConfigTestListBuilder Defines a class to build a listing of ConfigTest entities.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.