5 * Contains \Drupal\linkit\ProfileListBuilder.
8 namespace Drupal\linkit;
10 use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
11 use Drupal\Core\Entity\EntityInterface;
15 * Defines a class to build a listing of profile entities.
17 * @see \Drupal\linkit\Entity\Profile
19 class ProfileListBuilder extends ConfigEntityListBuilder {
24 public function buildHeader() {
25 $header['title'] = t('Profile');
26 $header['description'] = [
27 'data' => t('Description'),
28 'class' => [RESPONSIVE_PRIORITY_MEDIUM],
30 return $header + parent::buildHeader();
36 public function buildRow(EntityInterface $entity) {
37 /** @var \Drupal\linkit\ProfileInterface $linkitProfile */
38 $linkitProfile = $entity;
39 $row['label'] = $linkitProfile->label();
40 $row['description']['data'] = ['#markup' => $linkitProfile->getDescription()];
41 return $row + parent::buildRow($entity);
47 public function getDefaultOperations(EntityInterface $entity) {
48 $operations = parent::getDefaultOperations($entity);
50 if (isset($operations['edit'])) {
51 $operations['edit']['title'] = t('Edit profile');
54 $operations['matchers'] = [
55 'title' => t('Manage matchers'),
57 'url' => Url::fromRoute('linkit.matchers', [
58 'linkit_profile' => $entity->id()
62 $operations['attributes'] = [
63 'title' => t('Manage attributes'),
65 'url' => Url::fromRoute('linkit.attributes', [
66 'linkit_profile' => $entity->id()