You are here

public function WebhookConfigListBuilder::buildRow in Webhooks 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

src/WebhookConfigListBuilder.php, line 59

Class

WebhookConfigListBuilder
Provides a listing of Webhook entities.

Namespace

Drupal\webhooks

Code

public function buildRow(EntityInterface $entity) {
  return [
    'label' => $entity
      ->label(),
    'url' => (new Url('webhooks.webhook_receive', [
      'incoming_webhook_name' => $entity
        ->id(),
    ]))
      ->setAbsolute()
      ->toString(),
    'id' => $entity
      ->id(),
    'type' => ucfirst($entity
      ->getType()),
    'status' => $entity
      ->status() ? $this
      ->t('Active') : $this
      ->t('Inactive'),
  ] + parent::buildRow($entity);
}