You are here

public function QueueExampleForm::__construct in Examples for Developers 8

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

queue_example/src/Forms/QueueExampleForm.php, line 61

Class

QueueExampleForm
Form with examples on how to use queue.

Namespace

Drupal\queue_example\Forms

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;
}