You are here

WSCallListBuilder.php in Web Service Data 2.0.x

Same filename and directory in other branches
  1. 8 src/WSCallListBuilder.php

Namespace

Drupal\wsdata

File

src/WSCallListBuilder.php
View source
<?php

namespace Drupal\wsdata;

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

/**
 * Provides a listing of Web Service Call entities.
 */
class WSCallListBuilder extends ConfigEntityListBuilder {

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

  /**
   * {@inheritdoc}
   */
  public function buildRow(EntityInterface $entity) {
    $row['label'] = Link::fromTextAndUrl($entity
      ->label(), $entity
      ->toUrl('canonical'));
    $row['id'] = $entity
      ->id();

    // You probably want a few more properties here...
    return $row + parent::buildRow($entity);
  }

}

Classes

Namesort descending Description
WSCallListBuilder Provides a listing of Web Service Call entities.