GridStackStylizerPluginBase.php in GridStack 8.2
File
src/GridStackStylizerPluginBase.php
View source
<?php
namespace Drupal\gridstack;
use Drupal\Core\Form\FormStateInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
abstract class GridStackStylizerPluginBase extends GridStackPluginBase implements GridStackStylizerPluginInterface {
protected $blazyEntity;
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
$instance = parent::create($container, $configuration, $plugin_id, $plugin_definition);
$instance->blazyEntity = $container
->get('blazy.entity');
return $instance;
}
public function attach(array &$load, array $attach = []) {
}
public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
}
protected function getVariantUniqueId($optionset) {
return $optionset
->id() . '__' . $optionset
->randomize();
}
}