public function MappingListBuilder::buildRow in GatherContent 8.4
Same name and namespace in other branches
- 8.5 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 113
Class
- MappingListBuilder
- Provides a listing of GatherContent Mapping entities.
Namespace
Drupal\gathercontent_uiCode
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['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;
}