TwitterProfileEntityListBuilder.php in Tweet Feed 8.3
File
src/TwitterProfileEntityListBuilder.php
View source
<?php
namespace Drupal\tweet_feed;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityListBuilder;
use Drupal\Core\Link;
class TwitterProfileEntityListBuilder extends EntityListBuilder {
public function buildHeader() {
$header['id'] = $this
->t('Tweet Profile Entity ID');
$header['name'] = $this
->t('Name');
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) {
$row['id'] = $entity
->getTwitterUserId();
$row['name'] = Link::createFromRoute($entity
->getName() . '/' . $entity
->getScreenName(), 'entity.twitter_profile.edit_form', [
'twitter_profile' => $entity
->id(),
]);
return $row + parent::buildRow($entity);
}
}