You are here

public function WSServerListBuilder::buildRow in Web Service Data 8

Same name and namespace in other branches
  1. 2.0.x src/WSServerListBuilder.php \Drupal\wsdata\WSServerListBuilder::buildRow()

Builds a row for an entity in the entity listing.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity for this row of the list.

Return value

array A render array structure of fields for this entity.

Overrides EntityListBuilder::buildRow

See also

\Drupal\Core\Entity\EntityListBuilder::render()

File

src/WSServerListBuilder.php, line 26

Class

WSServerListBuilder
Provides a listing of Web Service Server entities.

Namespace

Drupal\wsdata

Code

public function buildRow(EntityInterface $entity) {
  $connectors = \Drupal::service('plugin.manager.wsconnector');
  $connector_definitions = $connectors
    ->getDefinitions();
  $connector = $connector_definitions[$entity->wsconnector];
  $row['label'] = $entity
    ->label();
  $row['id'] = $entity
    ->id();
  $row['type'] = $connector['label']
    ->render();
  return $row + parent::buildRow($entity);
}