public function ContactEmailListBuilder::buildRow in Contact Emails 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/
ContactEmailListBuilder.php, line 31
Class
- ContactEmailListBuilder
- Defines the list builder for tax services.
Namespace
Drupal\contact_emailsCode
public function buildRow(EntityInterface $entity) {
/* @var $entity \Drupal\contact_emails\Entity\ContactEmailInterface */
/** @var \Drupal\contact\ContactFormInterface $contact_form */
$contact_form = $entity
->get('contact_form')->entity;
$row['id'] = $entity
->id();
$row['contact_form'] = $contact_form ? $contact_form
->label() : '';
$row['subject'] = $entity
->label();
$row['recipients'] = $this
->getRecipients($entity);
$row['status'] = $entity
->get('status')->value ? $this
->t('Enabled') : $this
->t('Disabled');
return $row + parent::buildRow($entity);
}