You are here

public function BookingListBuilder::buildRow in Booking and Availability Management Tools for Drupal 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

modules/bat_booking/src/BookingListBuilder.php, line 82
Contains \Drupal\bat_booking\BookingListBuilder.

Class

BookingListBuilder
Defines a class to build a listing of Unit entities.

Namespace

Drupal\bat_booking

Code

public function buildRow(EntityInterface $entity) {

  /* @var $entity \Drupal\bat\Entity\Unit */
  $row['id'] = $entity
    ->id();
  $row['name'] = $entity
    ->label();
  $row['bundle'] = bat_booking_type_load($entity
    ->bundle())
    ->label();
  $row['status'] = $entity
    ->getStatus() ? t('Published') : t('Unpublished');
  return $row + parent::buildRow($entity);
}