ContactListBuilder.php in RedHen CRM 8
File
modules/redhen_contact/src/ContactListBuilder.php
View source
<?php
namespace Drupal\redhen_contact;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityListBuilder;
use Drupal\Core\Url;
class ContactListBuilder extends EntityListBuilder {
public function buildHeader() {
$header['type'] = $this
->t('Type');
$header['name'] = $this
->t('Name');
$header['email'] = $this
->t('Email');
$header['status'] = $this
->t('Status');
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) {
$row['type'] = $entity
->getType();
$row['name'] = $entity
->toLink()
->toString();
$row['email'] = $entity
->getEmail();
$row['status'] = $entity
->isActive() ? $this
->t('Active') : $this
->t('Inactive');
return $row + parent::buildRow($entity);
}
}