You are here

MollieProfileListBuilder.php in Mollie Payment 8.2

File

src/Entity/MollieProfile/MollieProfileListBuilder.php
View source
<?php

namespace Drupal\mollie_payment\Entity\MollieProfile;

use Drupal\Core\Entity\EntityListBuilder;

/**
 * Lists mollie_profile entities.
 */
class MollieProfileListBuilder extends EntityListBuilder {

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

  /**
   * {@inheritdoc}
   */
  public function buildRow(\Drupal\mollie_payment\Entity\MollieProfile $entity) {

    // Label
    $row['label'] = $this
      ->getLabel($entity);

    // API key
    $row['apiKey'] = $entity
      ->getApiKey();
    return $row + parent::buildRow($entity);
  }

  /**
   * {@inheritdoc}
   */
  public function render() {
    $build = parent::render();
    $build['#empty'] = $this
      ->t('There are no Mollie profiles configured yet.');
    return $build;
  }

}

Classes

Namesort descending Description
MollieProfileListBuilder Lists mollie_profile entities.