class ScheduledTransitionsHooks in Scheduled Transitions 8
Same name and namespace in other branches
- 2.x src/ScheduledTransitionsHooks.php \Drupal\scheduled_transitions\ScheduledTransitionsHooks
Hooks for Scheduled Transitions module.
Hierarchy
- class \Drupal\scheduled_transitions\ScheduledTransitionsHooks implements ContainerInjectionInterface
Expanded class hierarchy of ScheduledTransitionsHooks
2 files declare their use of ScheduledTransitionsHooks
File
- src/
ScheduledTransitionsHooks.php, line 14
Namespace
Drupal\scheduled_transitionsView source
class ScheduledTransitionsHooks implements ContainerInjectionInterface {
/**
* The config factory.
*
* @var \Drupal\Core\Config\ConfigFactoryInterface
*/
protected $configFactory;
/**
* Job runner for Scheduled Transitions.
*
* @var \Drupal\scheduled_transitions\ScheduledTransitionsJobsInterface
*/
protected $scheduledTransitionsJobs;
/**
* Constructs a new ScheduledTransitionsHooks.
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $configFactory
* The config factory.
* @param \Drupal\scheduled_transitions\ScheduledTransitionsJobsInterface $scheduledTransitionsJobs
* Job runner for Scheduled Transitions.
*/
public function __construct(ConfigFactoryInterface $configFactory, ScheduledTransitionsJobsInterface $scheduledTransitionsJobs) {
$this->configFactory = $configFactory;
$this->scheduledTransitionsJobs = $scheduledTransitionsJobs;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static($container
->get('config.factory'), $container
->get('scheduled_transitions.jobs'));
}
/**
* Implements hook_cron().
*
* @see \scheduled_transitions_cron()
*/
public function cron() : void {
$settings = $this->configFactory
->get('scheduled_transitions.settings');
if (!empty($settings
->get('automation.cron_create_queue_items'))) {
$this->scheduledTransitionsJobs
->jobCreator();
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ScheduledTransitionsHooks:: |
protected | property | The config factory. | |
ScheduledTransitionsHooks:: |
protected | property | Job runner for Scheduled Transitions. | |
ScheduledTransitionsHooks:: |
public static | function |
Instantiates a new instance of this class. Overrides ContainerInjectionInterface:: |
|
ScheduledTransitionsHooks:: |
public | function | Implements hook_cron(). | |
ScheduledTransitionsHooks:: |
public | function | Constructs a new ScheduledTransitionsHooks. |