public function TwitterWidgetListBuilder::buildRow in Twitter Profile Widget 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/
TwitterWidgetListBuilder.php, line 37
Class
- TwitterWidgetListBuilder
- Defines a class to build a listing of Twitter widget entities.
Namespace
Drupal\twitter_profile_widgetCode
public function buildRow(EntityInterface $entity) {
/* @var $entity \Drupal\twitter_profile_widget\Entity\TwitterWidget */
$row['name'] = $this
->l($entity
->label(), new Url('entity.twitter_widget.canonical', [
'twitter_widget' => $entity
->id(),
]));
$row['type'] = $entity
->get('type')->value;
$row['account'] = $entity
->get('account')->value;
$row['timeline'] = $entity
->get('timeline')->value;
$row['search'] = $entity
->get('search')->value;
$row['count'] = $entity
->get('count')->value;
$row['replies'] = $entity
->get('replies')->value;
$row['retweets'] = $entity
->get('retweets')->value;
return $row + parent::buildRow($entity);
}