FontListBuilder.php in Open Social 10.2.x
Same filename and directory in other branches
- 8.9 modules/custom/social_font/src/FontListBuilder.php
- 8 modules/custom/social_font/src/FontListBuilder.php
- 8.2 modules/custom/social_font/src/FontListBuilder.php
- 8.3 modules/custom/social_font/src/FontListBuilder.php
- 8.4 modules/custom/social_font/src/FontListBuilder.php
- 8.5 modules/custom/social_font/src/FontListBuilder.php
- 8.6 modules/custom/social_font/src/FontListBuilder.php
- 8.7 modules/custom/social_font/src/FontListBuilder.php
- 8.8 modules/custom/social_font/src/FontListBuilder.php
- 10.3.x modules/custom/social_font/src/FontListBuilder.php
- 10.0.x modules/custom/social_font/src/FontListBuilder.php
- 10.1.x modules/custom/social_font/src/FontListBuilder.php
Namespace
Drupal\social_fontFile
modules/custom/social_font/src/FontListBuilder.phpView source
<?php
namespace Drupal\social_font;
use Drupal\Core\Link;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityListBuilder;
use Drupal\Core\Url;
/**
* Defines a class to build a listing of Font entities.
*
* @ingroup social_font
*/
class FontListBuilder extends EntityListBuilder {
/**
* {@inheritdoc}
*/
public function buildHeader() {
$header = [];
$header['id'] = $this
->t('Font ID');
$header['name'] = $this
->t('Name');
return $header + parent::buildHeader();
}
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity) {
$row = [];
/** @var \Drupal\social_font\Entity\Font $entity */
$row['id'] = $entity
->id();
$row['name'] = Link::fromTextAndUrl($entity
->label(), new Url('entity.font.edit_form', [
'font' => $entity
->id(),
]));
return $row + parent::buildRow($entity);
}
}
Classes
Name | Description |
---|---|
FontListBuilder | Defines a class to build a listing of Font entities. |