a12s-1.0.0-beta7/modules/page_context/src/Entity/PageContextFormListBuilder.php

modules/page_context/src/Entity/PageContextFormListBuilder.php
<?php

namespace Drupal\a12s_page_context\Entity;

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

/**
 * Provides a listing of page context forms.
 */
class PageContextFormListBuilder extends ConfigEntityListBuilder {

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

  /**
   * {@inheritdoc}
   */
  public function buildRow(EntityInterface $entity): array {
    /** @var \Drupal\a12s_page_context\Entity\PageContextFormInterface $entity */
    $row['label'] = $entity->label();
    $row['id'] = $entity->id();
    $row['status'] = $entity->status() ? $this->t('Enabled') : $this->t('Disabled');
    return $row + parent::buildRow($entity);
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc