You are here

public function MappingListBuilder::buildRow in GatherContent 8.5

Same name and namespace in other branches
  1. 8.4 gathercontent_ui/src/MappingListBuilder.php \Drupal\gathercontent_ui\MappingListBuilder::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

gathercontent_ui/src/MappingListBuilder.php, line 146

Class

MappingListBuilder
Provides a listing of GatherContent Mapping entities.

Namespace

Drupal\gathercontent_ui

Code

public function buildRow(EntityInterface $entity) {

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