RoleWatchdogListBuilder.php in Role Watchdog 8        
                          
                  
                        
  
  
  
  
  
File
  src/RoleWatchdogListBuilder.php
  
    View source  
  <?php
namespace Drupal\role_watchdog;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityListBuilder;
use Drupal\Core\Link;
class RoleWatchdogListBuilder extends EntityListBuilder {
  
  public function buildHeader() {
    $header['id'] = $this
      ->t('Role Watchdog ID');
    $header['name'] = $this
      ->t('Name');
    return $header + parent::buildHeader();
  }
  
  public function buildRow(EntityInterface $entity) {
    
    $row['id'] = $entity
      ->id();
    $row['name'] = Link::createFromRoute($entity
      ->label(), 'entity.role_watchdog.edit_form', [
      'role_watchdog' => $entity
        ->id(),
    ]);
    return $row + parent::buildRow($entity);
  }
}