public function PublishNow::doExecute in Scheduler 8
Same name and namespace in other branches
- 2.x scheduler_rules_integration/src/Plugin/RulesAction/PublishNow.php \Drupal\scheduler_rules_integration\Plugin\RulesAction\PublishNow::doExecute()
Set the node status to Published.
This action should really be provided by Rules or by Core, but it is not yet done (as of Aug 2016). Scheduler users need this action so we provide it here. It could be removed later when Rules or Core includes it.
File
- scheduler_rules_integration/
src/ Plugin/ RulesAction/ PublishNow.php, line 31
Class
- PublishNow
- Provides a 'Publish the node immediately' action.
Namespace
Drupal\scheduler_rules_integration\Plugin\RulesActionCode
public function doExecute() {
$node = $this
->getContextValue('node');
$node
->setPublished();
}