ThemeKeyRuleListBuilder.php in ThemeKey 8
File
src/Controller/ThemeKeyRuleListBuilder.php
View source
<?php
namespace Drupal\themekey\Controller;
use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
use Drupal\Core\Entity\EntityInterface;
class ThemeKeyRuleListBuilder extends ConfigEntityListBuilder {
public function buildHeader() {
$header['label'] = $this
->t('ThemeKey Rule');
$header['property'] = $this
->t('Property');
$header['key'] = $this
->t('Key');
$header['operator'] = $this
->t('Operator');
$header['value'] = $this
->t('Value');
$header['theme'] = $this
->t('Theme');
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) {
$row['label'] = $this
->getLabel($entity);
$row['property'] = $entity
->property();
$row['key'] = $entity
->key();
$row['operator'] = $entity
->operator();
$row['value'] = $entity
->value();
$row['theme'] = $entity
->theme();
return $row + parent::buildRow($entity);
}
}