You are here

GridStackSkinPluginBase.php in GridStack 8.2

Namespace

Drupal\gridstack

File

src/GridStackSkinPluginBase.php
View source
<?php

namespace Drupal\gridstack;

use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * Provides base class for all gridstack skins.
 */
abstract class GridStackSkinPluginBase extends GridStackPluginBase implements GridStackSkinPluginInterface {

  /**
   * The gridstack skin definitions.
   *
   * @var array
   */
  protected $skins;

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
    $instance = parent::create($container, $configuration, $plugin_id, $plugin_definition);
    $instance->skins = $instance
      ->setSkins();
    return $instance;
  }

  /**
   * {@inheritdoc}
   */
  public function skins() {
    return $this->skins;
  }

  /**
   * Sets the required plugin skins.
   */
  protected abstract function setSkins();

}

Classes

Namesort descending Description
GridStackSkinPluginBase Provides base class for all gridstack skins.