3 namespace Drupal\pathauto;
5 use Drupal\Core\Config\Entity\DraggableListBuilder;
6 use Drupal\Core\Entity\EntityInterface;
9 * Provides a listing of Pathauto pattern entities.
11 class PathautoPatternListBuilder extends DraggableListBuilder {
16 protected $limit = FALSE;
21 public function getFormId() {
22 return 'pathauto_pattern_list';
28 public function buildHeader() {
29 $header['label'] = $this->t('Label');
30 $header['pattern'] = $this->t('Pattern');
31 $header['type'] = $this->t('Pattern type');
32 $header['conditions'] = $this->t('Conditions');
33 return $header + parent::buildHeader();
39 public function buildRow(EntityInterface $entity) {
40 /* @var \Drupal\pathauto\PathautoPatternInterface $entity */
41 $row['label'] = $entity->label();
42 $row['patern']['#markup'] = $entity->getPattern();
43 $row['type']['#markup'] = $entity->getAliasType()->getLabel();
44 $row['conditions']['#theme'] = 'item_list';
45 foreach ($entity->getSelectionConditions() as $condition) {
46 $row['conditions']['#items'][] = $condition->summary();
48 return $row + parent::buildRow($entity);