Skip to content
Snippets Groups Projects
Commit e8dce594 authored by Levente Besenyei's avatar Levente Besenyei
Browse files

CS fixes

parent 7ab1962e
No related branches found
Tags 8.x-3.0-alpha32
No related merge requests found
......@@ -5,12 +5,40 @@ namespace Drupal\gdpr_tasks\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\gdpr_tasks\Entity\Task;
use Drupal\Core\Queue\QueueFactory;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Form for user task requests.
*/
class CreateGdprRequestOnBehalfOfUserForm extends FormBase {
/**
* The gdpr_tasks_process_gdpr_sar queue.
*
* @var \Drupal\Core\Queue\QueueInterface
*/
protected $queue;
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('queue')
);
}
/**
* Constructs a new CreateGdprRequestOnBehalfOfUserForm.
*
* @param \Drupal\Core\Queue\QueueFactory $queue
* Queue factory.
*/
public function __construct(QueueFactory $queue) {
$this->queue = $queue->get('gdpr_tasks_process_gdpr_sar');
}
/**
* {@inheritdoc}
*/
......@@ -55,9 +83,8 @@ class CreateGdprRequestOnBehalfOfUserForm extends FormBase {
$task->save();
if ($request_type === 'gdpr_sar') {
$queue = \Drupal::queue('gdpr_tasks_process_gdpr_sar');
$queue->createQueue();
$queue->createItem($task->id());
$this->queue->createQueue();
$this->queue->createItem($task->id());
}
$this->messenger()->addStatus('The request has been logged');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment