summaryrefslogtreecommitdiffstatshomepage
path: root/core/modules/navigation/src/TopBarItemBase.php
blob: 7e1dbd2cdfae723ffe2fc03ea60c181b7a5ac4b0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php

declare(strict_types=1);

namespace Drupal\navigation;

use Drupal\Component\Plugin\PluginBase;

/**
 * Base class for top bar item plugins.
 */
abstract class TopBarItemBase extends PluginBase implements TopBarItemPluginInterface {

  /**
   * {@inheritdoc}
   */
  public function label(): string|\Stringable {
    return $this->pluginDefinition['label'];
  }

  /**
   * {@inheritdoc}
   */
  public function region(): TopBarRegion {
    return $this->pluginDefinition['region'];
  }

  /**
   * {@inheritdoc}
   */
  abstract public function build(): array;

}