class NodeScheduler in Scheduler 2.x
Plugin for Node entity type.
@package Drupal\Scheduler\Plugin\Scheduler
Plugin annotation
@SchedulerPlugin(
id = "node_scheduler",
label = @Translation("Node Scheduler Plugin"),
description = @Translation("Provides support for scheduling node entities"),
entityType = "node",
typeFieldName = "type",
dependency = "node",
develGenerateForm = "devel_generate_form_content",
userViewRoute = "view.scheduler_scheduled_content.user_page",
)
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\scheduler\Plugin\Scheduler\NodeScheduler implements ContainerFactoryPluginInterface
- class \Drupal\scheduler\SchedulerPluginBase implements SchedulerPluginInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
Expanded class hierarchy of NodeScheduler
File
- src/
Plugin/ Scheduler/ NodeScheduler.php, line 24
Namespace
Drupal\scheduler\Plugin\SchedulerView source
class NodeScheduler extends SchedulerPluginBase implements ContainerFactoryPluginInterface {
/**
* Get the available types/bundles for the entity type.
*
* Do not use static or drupal_static here, because changes to third-party
* settings invalidate the saved values during phpunit testing.
*
* @return array
* The node type objects, keyed by node type name.
*/
public function getTypes() {
$nodeTypes = \Drupal::entityTypeManager()
->getStorage('node_type')
->loadMultiple();
return $nodeTypes;
}
/**
* Get the form IDs for node add/edit forms.
*
* @return array
* The list of form IDs.
*/
public function entityFormIds() {
static $ids;
if (!isset($ids)) {
$ids = [];
$types = array_keys($this
->getTypes());
foreach ($types as $typeId) {
// The node add form is named node_{type}_form. This is different from
// other entities, which have {entity}_{type}_add_form.
$ids[] = 'node_' . $typeId . '_form';
$ids[] = 'node_' . $typeId . '_edit_form';
}
}
return $ids;
}
/**
* Get the form IDs for node type forms.
*
* @return array
* The list of form IDs.
*/
public function entityTypeFormIds() {
return [
'node_type_add_form',
'node_type_edit_form',
];
}
}
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. | |
NodeScheduler:: |
public | function |
Get the form IDs for node add/edit forms. Overrides SchedulerPluginBase:: |
|
NodeScheduler:: |
public | function |
Get the form IDs for node type forms. Overrides SchedulerPluginBase:: |
|
NodeScheduler:: |
public | function |
Get the available types/bundles for the entity type. Overrides SchedulerPluginBase:: |
|
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:: |
public | function |
Get the type of entity supported by this plugin. Overrides SchedulerPluginInterface:: |
|
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. |