public function CreateActivityAction::create in Open Social 8.5
Same name and namespace in other branches
- 8.9 modules/custom/activity_basics/src/Plugin/ActivityAction/CreateActivityAction.php \Drupal\activity_basics\Plugin\ActivityAction\CreateActivityAction::create()
- 8 modules/custom/activity_basics/src/Plugin/ActivityAction/CreateActivityAction.php \Drupal\activity_basics\Plugin\ActivityAction\CreateActivityAction::create()
- 8.2 modules/custom/activity_basics/src/Plugin/ActivityAction/CreateActivityAction.php \Drupal\activity_basics\Plugin\ActivityAction\CreateActivityAction::create()
- 8.3 modules/custom/activity_basics/src/Plugin/ActivityAction/CreateActivityAction.php \Drupal\activity_basics\Plugin\ActivityAction\CreateActivityAction::create()
- 8.4 modules/custom/activity_basics/src/Plugin/ActivityAction/CreateActivityAction.php \Drupal\activity_basics\Plugin\ActivityAction\CreateActivityAction::create()
- 8.6 modules/custom/activity_basics/src/Plugin/ActivityAction/CreateActivityAction.php \Drupal\activity_basics\Plugin\ActivityAction\CreateActivityAction::create()
- 8.7 modules/custom/activity_basics/src/Plugin/ActivityAction/CreateActivityAction.php \Drupal\activity_basics\Plugin\ActivityAction\CreateActivityAction::create()
- 8.8 modules/custom/activity_basics/src/Plugin/ActivityAction/CreateActivityAction.php \Drupal\activity_basics\Plugin\ActivityAction\CreateActivityAction::create()
- 10.3.x modules/custom/activity_basics/src/Plugin/ActivityAction/CreateActivityAction.php \Drupal\activity_basics\Plugin\ActivityAction\CreateActivityAction::create()
- 10.0.x modules/custom/activity_basics/src/Plugin/ActivityAction/CreateActivityAction.php \Drupal\activity_basics\Plugin\ActivityAction\CreateActivityAction::create()
- 10.1.x modules/custom/activity_basics/src/Plugin/ActivityAction/CreateActivityAction.php \Drupal\activity_basics\Plugin\ActivityAction\CreateActivityAction::create()
- 10.2.x modules/custom/activity_basics/src/Plugin/ActivityAction/CreateActivityAction.php \Drupal\activity_basics\Plugin\ActivityAction\CreateActivityAction::create()
Creates a new message on the action with some logic behind it.
Overrides ActivityActionBase::create
File
- modules/
custom/ activity_basics/ src/ Plugin/ ActivityAction/ CreateActivityAction.php, line 21
Class
- CreateActivityAction
- Provides a 'CreateActivityAction' acitivy action.
Namespace
Drupal\activity_basics\Plugin\ActivityActionCode
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);
}
}
}