5 use Drupal\Core\Plugin\PluginBase;
8 * Defines a base tour item implementation.
10 * @see \Drupal\tour\Annotation\Tip
11 * @see \Drupal\tour\TipPluginInterface
12 * @see \Drupal\tour\TipPluginManager
15 abstract class TipPluginBase extends PluginBase implements TipPluginInterface {
18 * The label which is used for render of this tip.
25 * Allows tips to take more priority that others.
32 * The attributes that will be applied to the markup of this tip.
36 protected $attributes;
41 public function id() {
42 return $this->get('id');
48 public function getLabel() {
49 return $this->get('label');
55 public function getWeight() {
56 return $this->get('weight');
62 public function getAttributes() {
63 return $this->get('attributes') ?: [];
69 public function get($key) {
70 if (!empty($this->configuration[$key])) {
71 return $this->configuration[$key];
78 public function set($key, $value) {
79 $this->configuration[$key] = $value;