RelationTypeListBuilder.php in Relation 8
Same filename and directory in other branches
Contains \Drupal\relation\RelationTypeListBuilder.
Namespace
Drupal\relationFile
src/RelationTypeListBuilder.phpView source
<?php
/**
* @file
* Contains \Drupal\relation\RelationTypeListBuilder.
*/
namespace Drupal\relation;
use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Url;
/**
* Provides a listing of relation types.
*/
class RelationTypeListBuilder extends ConfigEntityListBuilder {
/**
* {@inheritdoc}
*/
public function buildHeader() {
$header['title'] = t('Name');
return $header + parent::buildHeader();
}
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity) {
$row['title'] = array(
'data' => $this
->getLabel($entity),
'class' => array(
'menu-label',
),
);
return $row + parent::buildRow($entity);
}
/**
* {@inheritdoc}
*/
public function render() {
$build = parent::render();
$build['#empty'] = t('No relation types exist. <a href="@link">Add relation type</a>.', array(
'@link' => Url::fromRoute('entity.relation_type.add_form'),
));
return $build;
}
}
Classes
Name | Description |
---|---|
RelationTypeListBuilder | Provides a listing of relation types. |