You are here

public function OrganizationListBuilder::buildRow in CRM Core 8

Same name and namespace in other branches
  1. 8.3 modules/crm_core_contact/src/OrganizationListBuilder.php \Drupal\crm_core_contact\OrganizationListBuilder::buildRow()
  2. 8.2 modules/crm_core_contact/src/OrganizationListBuilder.php \Drupal\crm_core_contact\OrganizationListBuilder::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_contact/src/OrganizationListBuilder.php, line 82

Class

OrganizationListBuilder
Class OrganizationListBuilder.

Namespace

Drupal\crm_core_contact

Code

public function buildRow(EntityInterface $entity) {
  $row = [];
  $row['label']['data'] = [
    '#type' => 'link',
    '#title' => $entity
      ->label(),
    '#url' => $entity
      ->toUrl(),
  ];
  $row['type'] = $entity
    ->get('type')->entity
    ->label();
  $row['changed'] = $this->dateFormatter
    ->format($entity
    ->get('changed')->value, 'short');
  return $row + parent::buildRow($entity);
}