buildHeader example

$entity_type,
      $entity_type_manager->getStorage($entity_type->id()),
      $entity_type_manager->getDefinitions()
    );
  }

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

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

  /** * {@inheritdoc} */
$this->limit = FALSE;
  }

  /** * {@inheritdoc} */
  public function buildHeader() {
    $header = [];
    if (!empty($this->weightKey)) {
      $header['weight'] = t('Weight');
    }
    return $header + parent::buildHeader();
  }

  /** * {@inheritdoc} */
  public function buildRow(EntityInterface $entity) {
    $row = [];
    if (!empty($this->weightKey)) {
      // Override default values to markup elements.       $row['#attributes']['class'][] = 'draggable';
      $row['#weight'] = $entity->get($this->weightKey);
      
return $entities;
  }

  /** * {@inheritdoc} */
  public function buildHeader() {
    $header['label'] = $this->t('Workspace');
    $header['uid'] = $this->t('Owner');

    return $header + parent::buildHeader();
  }

  /** * {@inheritdoc} */
  public function buildRow(EntityInterface $entity) {
    /** @var \Drupal\workspaces\WorkspaceInterface $entity */
    if (isset($entity->_depth) && $entity->_depth > 0) {
      $indentation = [
        '#theme' => 'indentation',
        '#size' => $entity->_depth,
      ];
$operations['edit']['weight'] = 30;
    }
    return $operations;
  }

  /** * {@inheritdoc} */
  public function buildHeader() {
    $header['type'] = t('Comment type');
    $header['description'] = t('Description');
    return $header + parent::buildHeader();
  }

  /** * {@inheritdoc} */
  public function buildRow(EntityInterface $entity) {
    $row['type'] = $entity->label();
    $row['description']['data'] = ['#markup' => $entity->getDescription()];
    return $row + parent::buildRow($entity);
  }

}
/** * {@inheritdoc} * * Builds the entity listing as renderable array for table.html.twig. * * @todo Add a link to add a new item to the #empty text. */
  public function render() {
    $build['table'] = [
      '#type' => 'table',
      '#header' => $this->buildHeader(),
      '#title' => $this->getTitle(),
      '#rows' => [],
      '#empty' => $this->t('There are no @label yet.', ['@label' => $this->entityType->getPluralLabel()]),
      '#cache' => [
        'contexts' => $this->entityType->getListCacheContexts(),
        'tags' => $this->entityType->getListCacheTags(),
      ],
    ];
    foreach ($this->load() as $entity) {
      if ($row = $this->buildRow($entity)) {
        $build['table']['#rows'][$entity->id()] = $row;
      }
public function buildRow(EntityInterface $entity) {
    $row['label']['data'] = $entity->label();
    $row['label']['class'][] = 'table-filter-text-source';
    return $row + parent::buildRow($entity);
  }

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

  /** * {@inheritdoc} */
  public function getOperations(EntityInterface $entity) {
    $operations = parent::getOperations($entity);
    foreach (array_keys($operations) as $operation) {
      // This is a translation UI for translators. Show the translation       // operation only.       if (!($operation == 'translate')) {
        
class NodeTypeListBuilder extends ConfigEntityListBuilder {

  /** * {@inheritdoc} */
  public function buildHeader() {
    $header['title'] = t('Name');
    $header['description'] = [
      'data' => t('Description'),
      'class' => [RESPONSIVE_PRIORITY_MEDIUM],
    ];
    return $header + parent::buildHeader();
  }

  /** * {@inheritdoc} */
  public function buildRow(EntityInterface $entity) {
    $row['title'] = [
      'data' => $entity->label(),
      'class' => ['menu-label'],
    ];
    $row['description']['data'] = ['#markup' => $entity->getDescription()];
    

class ContactFormListBuilder extends ConfigEntityListBuilder {

  /** * {@inheritdoc} */
  public function buildHeader() {
    $header['form'] = t('Form');
    $header['recipients'] = t('Recipients');
    $header['selected'] = t('Selected');
    return $header + parent::buildHeader();
  }

  /** * {@inheritdoc} */
  public function buildRow(EntityInterface $entity) {
    // Special case the personal form.     if ($entity->id() == 'personal') {
      $row['form'] = $entity->label();
      $row['recipients'] = t('Selected user');
      $row['selected'] = t('No');
    }
'data' => $this->t('Updated'),
        'class' => [RESPONSIVE_PRIORITY_LOW],
      ],
    ];
    // Enable language column if multiple languages are added.     if ($this->languageManager->isMultilingual()) {
      $header['language'] = [
        'data' => $this->t('Language'),
        'class' => [RESPONSIVE_PRIORITY_LOW],
      ];
    }
    return $header + parent::buildHeader();
  }

  /** * {@inheritdoc} */
  public function buildRow(EntityInterface $entity) {
    /** @var \Drupal\media\MediaInterface $entity */
    if ($this->thumbnailStyleExists) {
      $row['thumbnail'] = [];
      if ($thumbnail_uri = $entity->getSource()->getMetadata($entity, 'thumbnail_uri')) {
        $row['thumbnail']['data'] = [
          

  }

  /** * {@inheritdoc} */
  public function load() {
    $entity_query = $this->storage->getQuery();
    $entity_query->accessCheck(TRUE);
    $entity_query->condition('uid', 0, '<>');
    $entity_query->pager(50);
    $header = $this->buildHeader();
    $entity_query->tableSort($header);
    $uids = $entity_query->execute();
    return $this->storage->loadMultiple($uids);
  }

  /** * {@inheritdoc} */
  public function buildHeader() {
    $header = [
      'username' => [
        

class ImageStyleListBuilder extends ConfigEntityListBuilder {

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

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

  /** * {@inheritdoc} */

  public function getFormId() {
    return 'user_admin_roles_form';
  }

  /** * {@inheritdoc} */
  public function buildHeader() {
    $header['label'] = t('Name');
    return $header + parent::buildHeader();
  }

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

  /** * {@inheritdoc} */

class EntityTestListBuilder extends EntityListBuilder {

  /** * {@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);
  }

}
/** * Provides a listing of responsive image styles. */
class ResponsiveImageStyleListBuilder extends ConfigEntityListBuilder {

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

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

  /** * {@inheritdoc} */
return 'workflow_admin_overview_form';
  }

  /** * {@inheritdoc} */
  public function buildHeader() {
    $header['label'] = $this->t('Workflow');
    $header['type'] = $this->t('Type');
    $header['states'] = $this->t('States');

    return $header + parent::buildHeader();
  }

  /** * {@inheritdoc} */
  public function buildRow(EntityInterface $entity) {
    /** @var \Drupal\workflows\WorkflowInterface $entity */
    $row['label'] = $entity->label();

    $row['type']['data'] = [
      '#markup' => $entity->getTypePlugin()->label(),
    ];
Home | Imprint | This part of the site doesn't use cookies.