MentionsConfigListBuilder.php in Open Social 8.3
Same filename and directory in other branches
- 8.9 modules/custom/mentions/src/MentionsConfigListBuilder.php
- 8 modules/custom/mentions/src/MentionsConfigListBuilder.php
- 8.2 modules/custom/mentions/src/MentionsConfigListBuilder.php
- 8.4 modules/custom/mentions/src/MentionsConfigListBuilder.php
- 8.5 modules/custom/mentions/src/MentionsConfigListBuilder.php
- 8.6 modules/custom/mentions/src/MentionsConfigListBuilder.php
- 8.7 modules/custom/mentions/src/MentionsConfigListBuilder.php
- 8.8 modules/custom/mentions/src/MentionsConfigListBuilder.php
- 10.3.x modules/custom/mentions/src/MentionsConfigListBuilder.php
- 10.0.x modules/custom/mentions/src/MentionsConfigListBuilder.php
- 10.1.x modules/custom/mentions/src/MentionsConfigListBuilder.php
- 10.2.x modules/custom/mentions/src/MentionsConfigListBuilder.php
Namespace
Drupal\mentionsFile
modules/custom/mentions/src/MentionsConfigListBuilder.phpView source
<?php
namespace Drupal\mentions;
use Drupal\Core\Config\Entity\DraggableListBuilder;
use Drupal\Core\Entity\EntityInterface;
/**
* Provides a listing of Mentions Type entities.
*/
class MentionsConfigListBuilder extends DraggableListBuilder {
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'mentions_config_listbuilder_form';
}
/**
* {@inheritdoc}
*/
public function buildHeader() {
$header['id'] = $this
->t('Machine name');
return $header + parent::buildHeader();
}
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity) {
$row['id'] = $entity
->id();
return $row + parent::buildRow($entity);
}
/**
* {@inheritdoc}
*/
public function getDefaultOperations(EntityInterface $entity) {
$operations = parent::getDefaultOperations($entity);
if ($entity
->hasLinkTemplate('edit_form')) {
$operations['edit'] = [
'title' => $this
->t('Edit'),
'weight' => 10,
'url' => $entity
->toUrl('edit_form'),
];
}
if ($entity
->hasLinkTemplate('delete_form')) {
$operations['delete'] = [
'title' => $this
->t('Delete'),
'weight' => 20,
'url' => $entity
->toUrl('delete_form'),
];
}
return $operations;
}
}
Classes
Name | Description |
---|---|
MentionsConfigListBuilder | Provides a listing of Mentions Type entities. |