function QueueExampleForm::__construct

Same name in other branches
  1. 4.0.x modules/queue_example/src/Form/QueueExampleForm.php \Drupal\queue_example\Form\QueueExampleForm::__construct()

Constructor.

Parameters

\Drupal\Core\Queue\QueueFactory $queue_factory: Queue factory service to get new/existing queues for use.

\Drupal\Core\Database\Connection $database: The database connection to be used.

Drupal\Core\CronInterface $cron: The cron service.

Drupal\Core\Site\Settings $settings: The site settings.

File

modules/queue_example/src/Form/QueueExampleForm.php, line 61

Class

QueueExampleForm
Form with examples on how to use queue.

Namespace

Drupal\queue_example\Form

Code

public function __construct(QueueFactory $queue_factory, Connection $database, CronInterface $cron, Settings $settings) {
    $this->queueFactory = $queue_factory;
    $this->queueType = $settings->get('queue_default', 'queue.database');
    $this->database = $database;
    $this->cron = $cron;
}