Drupal 8  8.0.2
LocaleTranslation Class Reference
Inheritance diagram for LocaleTranslation:

Public Member Functions

 __construct (array $configuration, $plugin_id, array $plugin_definition, ModuleHandlerInterface $module_handler, QueueInterface $queue)
 
 processItem ($data)
 
- Public Member Functions inherited from PluginBase
 __construct (array $configuration, $plugin_id, $plugin_definition)
 
 getPluginId ()
 
 getBaseId ()
 
 getDerivativeId ()
 
 getPluginDefinition ()
 

Static Public Member Functions

static create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
 

Protected Attributes

 $moduleHandler
 
 $queue
 
- Protected Attributes inherited from PluginBase
 $pluginId
 
 $pluginDefinition
 
 $configuration
 

Additional Inherited Members

- Data Fields inherited from PluginBase
const DERIVATIVE_SEPARATOR = ':'
 

Detailed Description

Executes interface translation queue tasks.

( id = "locale_translation", title = ("Update translations"), cron = {"time" = 30} )

Constructor & Destructor Documentation

__construct ( array  $configuration,
  $plugin_id,
array  $plugin_definition,
ModuleHandlerInterface  $module_handler,
QueueInterface  $queue 
)

Constructs a new LocaleTranslation object.

Parameters
array$configurationA configuration array containing information about the plugin instance.
string$plugin_idThe plugin_id for the plugin instance.
array$plugin_definitionThe plugin implementation definition.
\Drupal\Core\Extension\ModuleHandlerInterface$module_handlerThe module handler.
\Drupal\Core\Queue\QueueInterface$queueThe queue object.

References Drupal\moduleHandler(), and Drupal\queue().

Here is the call graph for this function:

Member Function Documentation

static create ( ContainerInterface  $container,
array  $configuration,
  $plugin_id,
  $plugin_definition 
)
static

{Creates an instance of the plugin.

Parameters
\Symfony\Component\DependencyInjection\ContainerInterface$containerThe container to pull out services used in the plugin.
array$configurationA configuration array containing information about the plugin instance.
string$plugin_idThe plugin ID for the plugin instance.
mixed$plugin_definitionThe plugin implementation definition.
Returns
static Returns an instance of this plugin.
}

Implements ContainerFactoryPluginInterface.

processItem (   $data)

{Works on a single queue item.

Parameters
mixed$dataThe data that was passed to ::createItem() when the item was queued.
Exceptions
\ExceptionA QueueWorker plugin may throw an exception to indicate there was a problem. The cron process will log the exception, and leave the item in the queue to be processed again later.
\Drupal\Core\Queue\SuspendQueueExceptionMore specifically, a SuspendQueueException should be thrown when a QueueWorker plugin is aware that the problem will affect all subsequent workers of its queue. For example, a callback that makes HTTP requests may find that the remote server is not responding. The cron process will behave as with a normal Exception, and in addition will not attempt to process further items from the current item's queue during the current cron run.
See Also
::processQueues()
}

The translation update functions executed here are batch operations which are also used in translation update batches. The batch functions may need to be executed multiple times to complete their task, typically this is the translation import function. When a batch function is not finished, a new queue task is created and added to the end of the queue. The batch context data is needed to continue the batch task is stored in the queue with the queue data.

Implements QueueWorkerInterface.

References Drupal\moduleHandler(), and Drupal\queue().

Here is the call graph for this function:


The documentation for this class was generated from the following file: