abstract class SchedulerPluginBase in Scheduler 2.x
Base class for scheduler plugins.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
- class \Drupal\scheduler\SchedulerPluginBase implements SchedulerPluginInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
Expanded class hierarchy of SchedulerPluginBase
3 files declare their use of SchedulerPluginBase
- CommerceProductScheduler.php in src/
Plugin/ Scheduler/ CommerceProductScheduler.php - MediaScheduler.php in src/
Plugin/ Scheduler/ MediaScheduler.php - NodeScheduler.php in src/
Plugin/ Scheduler/ NodeScheduler.php
File
- src/
SchedulerPluginBase.php, line 11
Namespace
Drupal\schedulerView source
abstract class SchedulerPluginBase extends PluginBase implements SchedulerPluginInterface {
/**
* Create method.
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container
->get('string_translation'));
}
/**
* Get plugin label.
*
* @return string
* The label.
*/
public function label() {
return $this->pluginDefinition['label'];
}
/**
* Get the plugin description.
*
* @inheritDoc
*/
public function description() {
return $this->pluginDefinition['description'];
}
/**
* Get the type of entity supported by this plugin.
*
* @return string
* The name of the entity type.
*/
public function entityType() {
return $this->pluginDefinition['entityType'];
}
/**
* Get the name of the "type" field for the entity.
*
* @return string
* The name of the type/bundle field for this entity type.
*/
public function typeFieldName() {
return $this->pluginDefinition['typeFieldName'];
}
/**
* Get module dependency.
*
* @return string
* The name of the required module.
*/
public function dependency() {
return $this->pluginDefinition['dependency'];
}
/**
* Get the id of the Devel Generate form for this entity type.
*
* @return string
* The form id, or an empty string if none.
*/
public function develGenerateForm() {
return $this->pluginDefinition['develGenerateForm'];
}
/**
* Get the route of the scheduled view on the user profile page.
*
* @return string
* The form id, or an empty string if none.
*/
public function userViewRoute() {
return $this->pluginDefinition['userViewRoute'];
}
/**
* Get the Scheduler event class.
*
* @return string
* The event class.
*/
public function schedulerEventClass() {
// If no class is defined in the plugin then default to the standard
// scheduler class '\Drupal\scheduler\Event\Scheduler{Type}Events'.
$class = $this->pluginDefinition['schedulerEventClass'] ?? '\\Drupal\\scheduler\\Event\\Scheduler' . ucfirst($this
->entityType()) . 'Events';
return $class;
}
/**
* Get the publish action name of the entity type.
*
* If no value is given in the plugin annotation then default to the commonly
* used {entity type id}_publish_action.
*
* @return string
* The action name.
*/
public function publishAction() {
return $this->pluginDefinition['publishAction'] ?? $this
->entityType() . '_publish_action';
}
/**
* Get the unpublish action name of the entity type.
*
* If no value is given in the plugin annotation then default to the commonly
* used {entity type id}_unpublish_action.
*
* @return string
* The action name.
*/
public function unpublishAction() {
return $this->pluginDefinition['unpublishAction'] ?? $this
->entityType() . '_unpublish_action';
}
/**
* Get all the type/bundle objects for this entity.
*
* @return array
* The type/bundle objects.
*/
public abstract function getTypes();
/**
* Get the form IDs for entity add/edit forms.
*/
public abstract function entityFormIds();
/**
* Get the form IDs for entity type add/edit forms.
*/
public abstract function entityTypeFormIds();
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DependencySerializationTrait:: |
protected | property | ||
DependencySerializationTrait:: |
protected | property | ||
DependencySerializationTrait:: |
public | function | 2 | |
DependencySerializationTrait:: |
public | function | 2 | |
MessengerTrait:: |
protected | property | The messenger. | 27 |
MessengerTrait:: |
public | function | Gets the messenger. | 27 |
MessengerTrait:: |
public | function | Sets the messenger. | |
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:: |
2 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
PluginBase:: |
public | function | Constructs a \Drupal\Component\Plugin\PluginBase object. | 98 |
SchedulerPluginBase:: |
public static | function | Create method. | |
SchedulerPluginBase:: |
public | function |
Get module dependency. Overrides SchedulerPluginInterface:: |
|
SchedulerPluginBase:: |
public | function |
Get the plugin description. Overrides SchedulerPluginInterface:: |
|
SchedulerPluginBase:: |
public | function |
Get the id of the Devel Generate form for this entity type. Overrides SchedulerPluginInterface:: |
|
SchedulerPluginBase:: |
abstract public | function |
Get the form IDs for entity add/edit forms. Overrides SchedulerPluginInterface:: |
3 |
SchedulerPluginBase:: |
public | function |
Get the type of entity supported by this plugin. Overrides SchedulerPluginInterface:: |
|
SchedulerPluginBase:: |
abstract public | function |
Get the form IDs for entity type add/edit forms. Overrides SchedulerPluginInterface:: |
3 |
SchedulerPluginBase:: |
abstract public | function |
Get all the type/bundle objects for this entity. Overrides SchedulerPluginInterface:: |
3 |
SchedulerPluginBase:: |
public | function |
Get plugin label. Overrides SchedulerPluginInterface:: |
|
SchedulerPluginBase:: |
public | function |
Get the publish action name of the entity type. Overrides SchedulerPluginInterface:: |
|
SchedulerPluginBase:: |
public | function |
Get the Scheduler event class. Overrides SchedulerPluginInterface:: |
|
SchedulerPluginBase:: |
public | function |
Get the name of the "type" field for the entity. Overrides SchedulerPluginInterface:: |
|
SchedulerPluginBase:: |
public | function |
Get the unpublish action name of the entity type. Overrides SchedulerPluginInterface:: |
|
SchedulerPluginBase:: |
public | function |
Get the route of the scheduled view on the user profile page. Overrides SchedulerPluginInterface:: |
|
StringTranslationTrait:: |
protected | property | The string translation service. | 4 |
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. |