Skip to content

Instantly share code, notes, and snippets.

langcode: en
status: true
dependencies:
module:
- article_queue
title: 'Article Queue Worker'
id: article_queue_worker
module: article_queue
callback: article_queue_article_cronjob
<?php
namespace Drupal\article_queue\Plugin\QueueWorker;
use Drupal\Core\Queue\QueueWorkerBase;
use Drupal\node\Entity\Node;
/**
* Processes Node Tasks.
*
article_queue.article_settings_form:
path: '/admin/config/article_queue/articlesettings'
defaults:
_form: '\Drupal\article_queue\Form\ArticleSettingsForm'
_title: 'ArticleSettingsForm'
requirements:
_permission: 'access administration pages'
options:
_admin_route: TRUE
<?php
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Queue\QueueFactory;
use Drupal\Core\Queue\QueueInterface;
/**
* Implements hook_help().
*/
function article_queue_help($route_name, RouteMatchInterface $route_match) {
name: Article Queue
type: module
description: This module will provide an exapmle for queue worker.
core: 8.x
package: Custom
dependencies:
- ultimate_cron
- queue_ui
<?php
namespace Drupal\article_queue\Form;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Class ArticleSettingsForm.
*/
<?php
namespace Drupal\batch_example;
use Drupal\node\Entity\Node;
class DeleteNode {
public static function deleteNodeExample($nids, &$context){
<?php
namespace Drupal\batch_example\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Class DeleteNodeForm.
*
batch_example.delete_node_example:
path: '/batch-example/delete'
defaults:
_form: '\Drupal\batch_example\Form\DeleteNodeForm'
_title: 'Batch Example'
requirements:
_permission: 'access content'
name: batch_example
type: module
description: Example module for batch process
core: 8.x
package: Example