ConnectionRoleListBuilder.php in RedHen CRM 8
File
modules/redhen_connection/src/ConnectionRoleListBuilder.php
View source
<?php
namespace Drupal\redhen_connection;
use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
use Drupal\Core\Entity\EntityInterface;
class ConnectionRoleListBuilder extends ConfigEntityListBuilder {
protected function getEntityIds() {
$query = $this
->getStorage()
->getQuery()
->sort($this->entityType
->getKey('id'));
if ($connection_type = \Drupal::routeMatch()
->getParameter('redhen_connection_type')) {
$query
->condition('connection_type', $connection_type
->id(), '=');
}
if ($this->limit) {
$query
->pager($this->limit);
}
return $query
->execute();
}
public function buildHeader() {
$header['label'] = $this
->t('Connection Role');
$header['id'] = $this
->t('Machine name');
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) {
$row['label'] = $entity
->label();
$row['id'] = $entity
->id();
return $row + parent::buildRow($entity);
}
}