public static function StateChange::create in Workbench Moderation Actions 8
Same name in this branch
- 8 src/Controller/StateChange.php \Drupal\workbench_moderation_actions\Controller\StateChange::create()
- 8 src/Plugin/Action/StateChange.php \Drupal\workbench_moderation_actions\Plugin\Action\StateChange::create()
Instantiates a new instance of this class.
This is a factory method that returns a new instance of this class. The factory should pass any needed dependencies into the constructor of this class, but not the container itself. Every call to this method must return a new instance of this class; that is, it may not implement a singleton.
Parameters
\Symfony\Component\DependencyInjection\ContainerInterface $container: The service container this instance should use.
Overrides ControllerBase::create
File
- src/
Controller/ StateChange.php, line 44
Class
- StateChange
- Performs the state change, if user has access to do it.
Namespace
Drupal\workbench_moderation_actions\ControllerCode
public static function create(ContainerInterface $container) {
return new static($container
->get('workbench_moderation.moderation_information'), $container
->get('workbench_moderation.state_transition_validation'));
}