You are here

public function YamlFormSubmissionListBuilder::buildRow in YAML Form 8

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/YamlFormSubmissionListBuilder.php, line 327

Class

YamlFormSubmissionListBuilder
Provides a list controller for yamlform submission entity.

Namespace

Drupal\yamlform

Code

public function buildRow(EntityInterface $entity) {
  $route_name = $this->requestHandler
    ->getRouteName($entity, $this->sourceEntity, $this
    ->getSubmissionRouteName());
  $route_parameters = $this->requestHandler
    ->getRouteParameters($entity, $this->sourceEntity);
  $row = [
    'data' => [],
    'data-yamlform-href' => Url::fromRoute($route_name, $route_parameters)
      ->toString(),
  ];
  foreach ($this->columns as $column_name => $column) {
    $row['data'][$column_name] = $this
      ->buildRowColumn($column, $entity);
  }
  return $row;
}