You are here

public function UrlRedirectListBuilder::buildRow in Url Redirect 8

Same name and namespace in other branches
  1. 8.2 src/Controller/UrlRedirectListBuilder.php \Drupal\url_redirect\Controller\UrlRedirectListBuilder::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

src/Controller/UrlRedirectListBuilder.php, line 46

Class

UrlRedirectListBuilder
Provides a listing of UrlRedirect.

Namespace

Drupal\url_redirect\Controller

Code

public function buildRow(EntityInterface $entity) {
  $row['label'] = $this
    ->getLabel($entity);
  $row['path'] = $entity
    ->get_path();
  $row['redirect_path'] = $entity
    ->get_redirect_path();
  $row['checked_for'] = $entity
    ->get_checked_for();
  $row['message'] = $entity
    ->get_message();
  if ($entity
    ->get_status()) {
    $status = t('Enabled');
  }
  else {
    $status = t('Disabled');
  }
  $row['status'] = $status;

  // You probably want a few more properties here...
  return $row + parent::buildRow($entity);
}