You are here

public function ActivityListBuilder::buildRow in CRM Core 8.3

Same name and namespace in other branches
  1. 8 modules/crm_core_activity/src/ActivityListBuilder.php \Drupal\crm_core_activity\ActivityListBuilder::buildRow()
  2. 8.2 modules/crm_core_activity/src/ActivityListBuilder.php \Drupal\crm_core_activity\ActivityListBuilder::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

modules/crm_core_activity/src/ActivityListBuilder.php, line 41

Class

ActivityListBuilder
Activity List Builder.

Namespace

Drupal\crm_core_activity

Code

public function buildRow(EntityInterface $entity) {
  $row = [];
  $row['date']['data'] = $entity
    ->get('activity_date')
    ->view([
    'label' => 'hidden',
  ]);
  $row['title']['data'] = [
    '#type' => 'link',
    '#title' => $entity
      ->label(),
    '#url' => $entity
      ->toUrl(),
  ];
  $row['type'] = $entity
    ->get('type')->entity
    ->label();
  return $row + parent::buildRow($entity);
}