abstract class SiteimproveDomainBase in Siteimprove 8
Base class for Siteimprove domain plugins.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\siteimprove\Plugin\SiteimproveDomainBase implements ContainerFactoryPluginInterface, SiteimproveDomainInterface uses ConfigFormBaseTrait, StringTranslationTrait
Expanded class hierarchy of SiteimproveDomainBase
3 files declare their use of SiteimproveDomainBase
- DomainAccess.php in siteimprove_domain_access/
src/ Plugin/ SiteimproveDomain/ DomainAccess.php - Simple.php in src/
Plugin/ SiteimproveDomain/ Simple.php - Single.php in src/
Plugin/ SiteimproveDomain/ Single.php
File
- src/
Plugin/ SiteimproveDomainBase.php, line 17
Namespace
Drupal\siteimprove\PluginView source
abstract class SiteimproveDomainBase extends PluginBase implements ContainerFactoryPluginInterface, SiteimproveDomainInterface {
use StringTranslationTrait;
use ConfigFormBaseTrait;
/**
* The config factory.
*
* Subclasses should use the self::config() method, which may be overridden to
* address specific needs when loading config, rather than this property
* directly. See \Drupal\Core\Form\ConfigFormBase::config() for an example of
* this.
*
* @var \Drupal\Core\Config\ConfigFactoryInterface
*/
protected $configFactory;
/**
* Constructs a new SiteimproveDomainBase object.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin_id for the plugin instance.
* @param array $plugin_definition
* The plugin implementation definition.
* @param \Drupal\Core\Config\ConfigFactoryInterface $configFactory
* The config factory.
*/
public function __construct(array $configuration, $plugin_id, array $plugin_definition, ConfigFactoryInterface $configFactory) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->configFactory = $configFactory;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container
->get('config.factory'));
}
/**
* {@inheritdoc}
*/
public function getName() {
return $this->pluginDefinition['name'];
}
/**
* {@inheritdoc}
*/
public function buildForm(array &$form, FormStateInterface &$form_state, $plugin_definition) {
$form[$plugin_definition['id']] = [
'#type' => 'fieldset',
'#title' => $plugin_definition['label'],
];
}
/**
* {@inheritdoc}
*/
public function validateForm(array &$form, FormStateInterface $form_state) {
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
}
/**
* Return urls for active domains for this entity.
*
* If http/https isn't specified in domain name, use the backend's scheme.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* Entity to get active domain names for.
*
* @return array
* Array of domain names without trailing slash.
*/
public function getUrls(EntityInterface $entity) {
return [];
}
/**
* {@inheritdoc}
*/
protected function getEditableConfigNames() {
return [];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigFormBaseTrait:: |
protected | function | Retrieves a configuration object. | |
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
SiteimproveDomainBase:: |
protected | property | The config factory. | |
SiteimproveDomainBase:: |
public | function |
Form constructor. Overrides SiteimproveDomainInterface:: |
3 |
SiteimproveDomainBase:: |
public static | function |
Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: |
2 |
SiteimproveDomainBase:: |
protected | function |
Gets the configuration names that will be editable. Overrides ConfigFormBaseTrait:: |
1 |
SiteimproveDomainBase:: |
public | function | ||
SiteimproveDomainBase:: |
public | function | Return urls for active domains for this entity. | 3 |
SiteimproveDomainBase:: |
public | function |
Form submission handler. Overrides SiteimproveDomainInterface:: |
3 |
SiteimproveDomainBase:: |
public | function |
Form validation handler. Overrides SiteimproveDomainInterface:: |
1 |
SiteimproveDomainBase:: |
public | function |
Constructs a new SiteimproveDomainBase object. Overrides PluginBase:: |
2 |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |