You are here

public function GathercontentMappingListBuilder::buildRow in GatherContent 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/GathercontentMappingListBuilder.php, line 80

Class

GathercontentMappingListBuilder
Provides a listing of GatherContent Mapping entities.

Namespace

Drupal\gathercontent

Code

public function buildRow(EntityInterface $entity) {

  /** @var \Drupal\gathercontent\Entity\GathercontentMapping $entity */
  $exists = isset($this->templates[$entity
    ->getGathercontentTemplateId()]);
  $row['project'] = $entity
    ->getGathercontentProject();
  $row['gathercontent_template'] = $entity
    ->getGathercontentTemplate();
  $row['content_type'] = $entity
    ->getFormattedContentType();
  $row['updated_gathercontent'] = $exists ? \Drupal::service('date.formatter')
    ->format($this->templates[$entity
    ->getGathercontentTemplateId()], 'custom', 'M d, Y - H:i') : t("Deleted");
  $row['updated_drupal'] = $entity
    ->getFormatterUpdatedDrupal();
  if ($exists) {
    $row = $row + parent::buildRow($entity);
  }
  return $row;
}