class CreateActivityAction in Open Social 8.2
Same name and namespace in other branches
- 8.9 modules/custom/activity_basics/src/Plugin/ActivityAction/CreateActivityAction.php \Drupal\activity_basics\Plugin\ActivityAction\CreateActivityAction
- 8 modules/custom/activity_basics/src/Plugin/ActivityAction/CreateActivityAction.php \Drupal\activity_basics\Plugin\ActivityAction\CreateActivityAction
- 8.3 modules/custom/activity_basics/src/Plugin/ActivityAction/CreateActivityAction.php \Drupal\activity_basics\Plugin\ActivityAction\CreateActivityAction
- 8.4 modules/custom/activity_basics/src/Plugin/ActivityAction/CreateActivityAction.php \Drupal\activity_basics\Plugin\ActivityAction\CreateActivityAction
- 8.5 modules/custom/activity_basics/src/Plugin/ActivityAction/CreateActivityAction.php \Drupal\activity_basics\Plugin\ActivityAction\CreateActivityAction
- 8.6 modules/custom/activity_basics/src/Plugin/ActivityAction/CreateActivityAction.php \Drupal\activity_basics\Plugin\ActivityAction\CreateActivityAction
- 8.7 modules/custom/activity_basics/src/Plugin/ActivityAction/CreateActivityAction.php \Drupal\activity_basics\Plugin\ActivityAction\CreateActivityAction
- 8.8 modules/custom/activity_basics/src/Plugin/ActivityAction/CreateActivityAction.php \Drupal\activity_basics\Plugin\ActivityAction\CreateActivityAction
- 10.3.x modules/custom/activity_basics/src/Plugin/ActivityAction/CreateActivityAction.php \Drupal\activity_basics\Plugin\ActivityAction\CreateActivityAction
- 10.0.x modules/custom/activity_basics/src/Plugin/ActivityAction/CreateActivityAction.php \Drupal\activity_basics\Plugin\ActivityAction\CreateActivityAction
- 10.1.x modules/custom/activity_basics/src/Plugin/ActivityAction/CreateActivityAction.php \Drupal\activity_basics\Plugin\ActivityAction\CreateActivityAction
- 10.2.x modules/custom/activity_basics/src/Plugin/ActivityAction/CreateActivityAction.php \Drupal\activity_basics\Plugin\ActivityAction\CreateActivityAction
Provides a 'CreateActivityAction' acitivy action.
Plugin annotation
@ActivityAction(
id = "create_entitiy_action",
label = @Translation("Action that is triggered when a entity is created"),
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\activity_creator\Plugin\ActivityActionBase implements ActivityActionInterface
- class \Drupal\activity_basics\Plugin\ActivityAction\CreateActivityAction
- class \Drupal\activity_creator\Plugin\ActivityActionBase implements ActivityActionInterface
Expanded class hierarchy of CreateActivityAction
File
- modules/
custom/ activity_basics/ src/ Plugin/ ActivityAction/ CreateActivityAction.php, line 16
Namespace
Drupal\activity_basics\Plugin\ActivityActionView source
class CreateActivityAction extends ActivityActionBase {
/**
* {@inheritdoc}
*/
public function create($entity) {
if ($this
->isValidEntity($entity)) {
// For nodes we make an exception, since they are potentially placed in
// groups, which we cannot know here yet.
if ($entity instanceof Node) {
$data['entity_id'] = $entity
->id();
$queue = \Drupal::queue('activity_logger_message');
$queue
->createItem($data);
}
else {
$this
->createMessage($entity);
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ActivityActionBase:: |
public | function |
Dumb function that can be called to create the message. Overrides ActivityActionInterface:: |
|
ActivityActionBase:: |
public | function |
Checks if this is a valid entity for the action. Overrides ActivityActionInterface:: |
|
CreateActivityAction:: |
public | function |
Creates a new message on the action with some logic behind it. Overrides ActivityActionBase:: |
|
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. | |
PluginBase:: |
public | function | Constructs a \Drupal\Component\Plugin\PluginBase object. | 92 |