more_fields-2.2.19/modules/video/src/MultiformatVideoListBuilder.php
modules/video/src/MultiformatVideoListBuilder.php
<?php
namespace Drupal\more_fields_video;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityListBuilder;
/**
* Provides a list controller for the multiformat video entity type.
*/
class MultiformatVideoListBuilder extends EntityListBuilder {
/**
* {@inheritdoc}
*/
public function render() {
$build['table'] = parent::render();
$total = $this->getStorage()
->getQuery()
->accessCheck(FALSE)
->count()
->execute();
$build['summary']['#markup'] = $this->t('Total multiformat videos: @total', ['@total' => $total]);
return $build;
}
/**
* {@inheritdoc}
*/
public function buildHeader() {
$header['id'] = $this->t('ID');
return $header + parent::buildHeader();
}
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity) {
/** @var \Drupal\more_fields_video\MultiformatVideoInterface $entity */
$row['id'] = $entity->id();
return $row + parent::buildRow($entity);
}
}
