class CronJob in Ultimate Cron 8.2
Class for handling cron jobs.
This class represents the jobs available in the system.
Plugin annotation
@ConfigEntityType(
id = "ultimate_cron_job",
label = @Translation("Cron Job"),
handlers = {
"access" = "Drupal\ultimate_cron\CronJobAccessControlHandler",
"list_builder" = "Drupal\ultimate_cron\CronJobListBuilder",
"form" = {
"default" = "Drupal\ultimate_cron\Form\CronJobForm",
"delete" = "\Drupal\Core\Entity\EntityDeleteForm",
"disable" = "Drupal\ultimate_cron\Form\CronJobDisableForm",
"enable" = "Drupal\ultimate_cron\Form\CronJobEnableForm",
}
},
config_prefix = "job",
admin_permission = "administer ultimate cron",
entity_keys = {
"id" = "id",
"label" = "title",
"status" = "status",
"weight" = "weight",
},
config_export = {
"title",
"id",
"status",
"weight",
"module",
"callback",
"scheduler",
"launcher",
"logger",
},
links = {
"edit-form" = "/admin/config/system/cron/jobs/manage/{ultimate_cron_job}",
"delete-form" = "/admin/config/system/cron/jobs/manage/{ultimate_cron_job}/delete",
"collection" = "/admin/config/system/cron/jobs",
"run" = "/admin/config/system/cron/jobs/{ultimate_cron_job}/run",
"disable" = "/admin/config/system/cron/jobs/manage/{ultimate_cron_job}/disable",
"enable" = "/admin/config/system/cron/jobs/manage/{ultimate_cron_job}/enable",
"logs" = "/admin/config/system/cron/jobs/logs/{ultimate_cron_job}",
"unlock" = "/admin/config/system/cron/jobs/{ultimate_cron_job}/unlock",
}
)
Hierarchy
- class \Drupal\Core\Entity\EntityBase implements EntityInterface uses RefinableCacheableDependencyTrait, DependencySerializationTrait
- class \Drupal\Core\Config\Entity\ConfigEntityBase implements ConfigEntityInterface uses SynchronizableEntityTrait, PluginDependencyTrait
- class \Drupal\ultimate_cron\Entity\CronJob implements CronJobInterface
- class \Drupal\Core\Config\Entity\ConfigEntityBase implements ConfigEntityInterface uses SynchronizableEntityTrait, PluginDependencyTrait
Expanded class hierarchy of CronJob
20 files declare their use of CronJob
- CronJobDiscovery.php in src/
CronJobDiscovery.php - CronJobFormTest.php in tests/
src/ Functional/ CronJobFormTest.php - CronJobInstallTest.php in tests/
src/ Functional/ CronJobInstallTest.php - CronJobKernelTest.php in tests/
src/ Kernel/ CronJobKernelTest.php - CronJobTest.php in tests/
src/ Kernel/ CronJobTest.php
File
- src/
Entity/ CronJob.php, line 61
Namespace
Drupal\ultimate_cron\EntityView source
class CronJob extends ConfigEntityBase implements CronJobInterface {
public static $signals;
public static $currentJob;
public $progressUpdated = 0;
public $settings;
/**
* @var int
*/
protected $id;
/**
* @var int
*/
protected $uuid;
/**
* @var bool
*/
protected $status = TRUE;
/**
* The weight.
*
* @var int
*/
protected $weight = 0;
/**
* @var string
*/
protected $title;
/**
* @var string
*/
protected $callback;
/**
* @var string
*/
protected $module;
/**
* @var array
*/
protected $scheduler = array(
'id' => 'simple',
);
/**
* @var array
*/
protected $launcher = array(
'id' => 'serial',
);
/**
* @var array
*/
protected $logger = array(
'id' => 'database',
);
/**
* @var \Drupal\ultimate_cron\CronPlugin
*/
protected $plugins = [];
/**
* The class resolver.
*
* @var \Drupal\Core\DependencyInjection\ClassResolverInterface
*/
protected $classResolver;
/**
* The module extension list service.
*
* @var \Drupal\Core\Extension\ModuleExtensionList
*/
protected $moduleExtensionList;
/**
* CronJob constructor.
*
* @param array $values
* @param string $entity_type
*/
public function __construct(array $values, $entity_type) {
parent::__construct($values, $entity_type);
$this->classResolver = \Drupal::service('class_resolver');
$this->moduleExtensionList = \Drupal::service('extension.list.module');
}
/**
* {@inheritdoc}
*/
public function postSave(EntityStorageInterface $storage, $update = TRUE) {
parent::postSave($storage, $update);
if ($update && empty($this->dont_log)) {
$log = $this
->startLog(uniqid($this
->id(), TRUE), '', ULTIMATE_CRON_LOG_TYPE_ADMIN);
$log
->log('Job modified by ' . $log
->formatUser(), array(), RfcLogLevel::INFO);
$log
->finish();
}
}
/**
* Set configuration for a given plugin type.
*
* @param string $plugin_type
* launcher, logger or scheduler.
* @param array $configuration
* The configuration array.
*/
public function setConfiguration($plugin_type, array $configuration) {
$this->{$plugin_type}['configuration'] = $configuration;
}
/**
* {@inheritdoc}
*/
public static function postDelete(EntityStorageInterface $storage, array $entities) {
foreach ($entities as $entity) {
if (empty($entity->dont_log)) {
/** @var \Drupal\ultimate_cron\Entity\CronJob $entity */
$log = $entity
->startLog(uniqid($entity
->id(), TRUE), 'modification', ULTIMATE_CRON_LOG_TYPE_ADMIN);
$log
->log('Job deleted by ' . $log
->formatUser(), array(), RfcLogLevel::INFO);
$log
->finish();
}
}
}
/**
* {@inheritdoc}
*/
public function isValid() {
return is_callable($this
->getCallback());
}
/**
* Get a signal without affecting it.
*
* @see UltimateCronSignal::peek()
*/
public function peekSignal($signal) {
if (isset(self::$signals[$this
->id()][$signal])) {
return TRUE;
}
$signal = \Drupal::service('ultimate_cron.signal');
return $signal
->peek($this
->id(), $signal);
}
/**
* Get a signal and clear it if found.
*
* @see UltimateCronSignal::get()
*/
public function getSignal($signal) {
if (isset(self::$signals[$this
->id()][$signal])) {
unset(self::$signals[$this
->id()][$signal]);
return TRUE;
}
$service = \Drupal::service('ultimate_cron.signal');
return $service
->get($this
->id(), $signal);
}
/**
* Send a signal.
*
* @see UltimateCronSignal::set()
*/
public function sendSignal($signal, $persist = FALSE) {
if ($persist) {
$signal = \Drupal::service('ultimate_cron.signal');
$signal
->set($this
->id(), $signal);
}
else {
self::$signals[$this
->id()][$signal] = TRUE;
}
}
/**
* Clear a signal.
*
* @see UltimateCronSignal::clear()
*/
public function clearSignal($signal) {
unset(self::$signals[$this
->id()][$signal]);
$signal = \Drupal::service('ultimate_cron.signal');
$signal
->clear($this
->id(), $signal);
}
/**
* Send all signal for the job.
*
* @see UltimateCronSignal::flush()
*/
public function clearSignals() {
unset(self::$signals[$this
->id()]);
$signal = \Drupal::service('ultimate_cron.signal');
$signal
->flush($this
->id());
}
/**
* Get job plugin.
*
* If no plugin name is provided current plugin of the specified type will
* be returned.
*
* @param string $plugin_type
* Name of plugin type.
* @param string $name
* (optional) The name of the plugin.
*
* @return mixed
* Plugin instance of the specified type.
*/
public function getPlugin($plugin_type, $name = NULL) {
if ($name) {
return ultimate_cron_plugin_load($plugin_type, $name);
}
// @todo: enable static cache, needs unset when values change.
// if (isset($this->plugins[$plugin_type])) {
// return $this->plugins[$plugin_type];
// }
if ($name) {
}
elseif (!empty($this->{$plugin_type}['id'])) {
$name = $this->{$plugin_type}['id'];
}
else {
$name = $this->hook[$plugin_type]['name'];
}
/* @var \Drupal\Core\Plugin\DefaultPluginManager $manager */
$manager = \Drupal::service('plugin.manager.ultimate_cron.' . $plugin_type);
$this->plugins[$plugin_type] = $manager
->createInstance($name, isset($this->{$plugin_type}['configuration']) ? $this->{$plugin_type}['configuration'] : array());
return $this->plugins[$plugin_type];
}
/**
* Gets this plugin's configuration.
*
* @param $plugin_type
* The type of plugin.
* @return array
* An array of this plugin's configuration.
*/
public function getConfiguration($plugin_type) {
if (!isset($this->{$plugin_type}['configuration'])) {
$this->{$plugin_type}['configuration'] = $this
->getPlugin($plugin_type)
->defaultConfiguration();
}
return $this->{$plugin_type}['configuration'];
}
/**
* Signal page for plugins.
*/
public function signal($item, $plugin_type, $plugin_name, $signal) {
$plugin = ultimate_cron_plugin_load($plugin_type, $plugin_name);
return $plugin
->signal($item, $signal);
}
/**
* Invokes the jobs callback.
*/
protected function invokeCallback() {
$callback = $this
->getCallback();
return call_user_func($callback, $this);
}
/**
* Returns a callable for the given controller.
*
* @param string $callback
* A callback string.
*
* @return mixed
* A PHP callable.
*
* @throws \InvalidArgumentException
* If the callback class does not exist.
*/
protected function resolveCallback($callback) {
// Controller in the service:method notation.
$count = substr_count($callback, ':');
if ($count == 1) {
list($class_or_service, $method) = explode(':', $callback, 2);
}
elseif (strpos($callback, '::') !== FALSE) {
list($class_or_service, $method) = explode('::', $callback, 2);
}
else {
return $callback;
}
$callback = $this->classResolver
->getInstanceFromDefinition($class_or_service);
return array(
$callback,
$method,
);
}
/**
* Check job schedule.
*/
public function isScheduled() {
\Drupal::moduleHandler()
->invokeAll('cron_pre_schedule', array(
$this,
));
$result = $this
->status() && !$this
->isLocked() && $this
->getPlugin('scheduler')
->isScheduled($this);
\Drupal::moduleHandler()
->invokeAll('cron_post_schedule', array(
$this,
));
return $result;
}
/**
* Check if job is behind its schedule.
*
* @return bool|int
* FALSE if job is behind its schedule or number of seconds behind.
*/
public function isBehindSchedule() {
return $this
->getPlugin('scheduler')
->isBehind($this);
}
/**
* Lock job.
*/
public function lock() {
$launcher = $this
->getPlugin('launcher');
$lock_id = $launcher
->lock($this);
if (!$lock_id) {
\Drupal::logger('ultimate_cron')
->error('Could not get lock for job @name', array(
'@name' => $this
->id(),
));
return FALSE;
}
$this
->sendMessage('lock', array(
'lock_id' => $lock_id,
));
return $lock_id;
}
/**
* Unlock job.
*
* @param string $lock_id
* The lock id to unlock.
* @param bool $manual
* Whether or not this is a manual unlock.
*/
public function unlock($lock_id = NULL, $manual = FALSE) {
$result = NULL;
if (!$lock_id) {
$lock_id = $this
->isLocked();
}
if ($lock_id) {
$result = $this
->getPlugin('launcher')
->unlock($lock_id, $manual);
}
$this
->sendMessage('unlock', array(
'lock_id' => $lock_id,
));
return $result;
}
/**
* Get locked state of job.
*/
public function isLocked() {
return $this
->getPlugin('launcher')
->isLocked($this);
}
/**
* Get locked state for multiple jobs.
*
* @param array $jobs
* Jobs to check locks for.
*/
public static function isLockedMultiple($jobs) {
$launchers = array();
foreach ($jobs as $job) {
$launchers[$job
->getPlugin('launcher')->name][$job
->id()] = $job;
}
$locked = array();
foreach ($launchers as $launcher => $jobs) {
$locked += ultimate_cron_plugin_load('launcher', $launcher)
->isLockedMultiple($jobs);
}
return $locked;
}
/**
* {@inheritdoc}
*/
public function run($init_message = NULL) {
if (!$init_message) {
$init_message = t('Launched manually');
}
$lock_id = $this
->lock();
if (!$lock_id) {
return FALSE;
}
$log_entry = $this
->startLog($lock_id, $init_message);
$accountSwitcher = \Drupal::service('account_switcher');
try {
$this
->clearSignals();
$this
->initializeProgress();
\Drupal::moduleHandler()
->invokeAll('cron_pre_run', array(
$this,
));
// Force the current user to anonymous to ensure consistent permissions
// on cron runs.
$accountSwitcher
->switchTo(new AnonymousUserSession());
self::$currentJob = $this;
$this
->invokeCallback();
} catch (\Error $e) {
// PHP 7 throws Error objects in case of a fatal error. It will also call
// the finally block below and close the log entry. Because of that,
// the global fatal error catching will not work and we have to log it
// explicitly here instead. The advantage is that this will not
// interrupt the process.
$variables = Error::decodeException($e);
unset($variables['backtrace']);
$log_entry
->log('%type: @message in %function (line %line of %file).', $variables, RfcLogLevel::ERROR);
return FALSE;
} catch (\Exception $e) {
$variables = Error::decodeException($e);
unset($variables['backtrace']);
$log_entry
->log('%type: @message in %function (line %line of %file).', $variables, RfcLogLevel::ERROR);
return FALSE;
} finally {
self::$currentJob = NULL;
\Drupal::moduleHandler()
->invokeAll('cron_post_run', array(
$this,
));
$this
->finishProgress();
// Restore original user account.
$accountSwitcher
->switchBack();
$log_entry
->finish();
$this
->unlock($lock_id);
}
return TRUE;
}
/**
* Get log entries.
*
* @param int $limit
* (optional) Number of log entries per page.
*
* @return \Drupal\ultimate_cron\Logger\LogEntry[]
* Array of UltimateCronLogEntry objects.
*/
public function getLogEntries($log_types = ULTIMATE_CRON_LOG_TYPE_ALL, $limit = 10) {
$log_types = $log_types == ULTIMATE_CRON_LOG_TYPE_ALL ? _ultimate_cron_define_log_type_all() : $log_types;
return $this
->getPlugin('logger')
->getLogEntries($this
->id(), $log_types, $limit);
}
/**
* Load log entry.
*
* @param string $lock_id
* The lock id of the log entry.
*
* @return LogEntry
* The log entry.
*/
public function loadLogEntry($lock_id) {
return $this
->getPlugin('logger')
->load($this
->id(), $lock_id);
}
/**
* Load latest log.
*
* @return LogEntry
* The latest log entry for this job.
*/
public function loadLatestLogEntry($log_types = array(
ULTIMATE_CRON_LOG_TYPE_NORMAL,
)) {
return $this
->getPlugin('logger')
->load($this
->id(), NULL, $log_types);
}
/**
* Load latest log entries.
*
* @param array $jobs
* Jobs to load log entries for.
*
* @return array
* Array of UltimateCronLogEntry objects.
*/
public static function loadLatestLogEntries($jobs, $log_types = array(
ULTIMATE_CRON_LOG_TYPE_NORMAL,
)) {
$loggers = array();
foreach ($jobs as $job) {
$loggers[$job
->getPlugin('logger')->name][$job
->id()] = $job;
}
$log_entries = array();
foreach ($loggers as $logger => $jobs) {
$log_entries += ultimate_cron_plugin_load('logger', $logger)
->loadLatestLogEntries($jobs, $log_types);
}
return $log_entries;
}
/**
* {@inheritdoc}
*/
public function startLog($lock_id, $init_message = '', $log_type = ULTIMATE_CRON_LOG_TYPE_NORMAL) {
$logger = $this
->getPlugin('logger');
$log_entry = $logger
->createEntry($this
->id(), $lock_id, $init_message, $log_type);
\Drupal::service('logger.ultimate_cron')
->catchMessages($log_entry);
return $log_entry;
}
/**
* Resume a previosly saved log.
*
* @param string $lock_id
* The lock id of the log to resume.
*
* @return LogEntry
* The log entry object.
*/
public function resumeLog($lock_id) {
$logger = $this
->getPlugin('logger');
$log_entry = $logger
->load($this
->id(), $lock_id);
$log_entry->finished = FALSE;
\Drupal::service('logger.ultimate_cron')
->catchMessages($log_entry);
return $log_entry;
}
/**
* Get module name for this job.
*/
public function getModuleName() {
static $names = array();
if (!isset($names[$this->module])) {
$info = $this->moduleExtensionList
->getExtensionInfo($this->module);
$names[$this->module] = $info && !empty($info['name']) ? $info['name'] : $this->module;
}
return $names[$this->module];
}
/**
* Get module description for this job.
*/
public function getModuleDescription() {
static $descs = array();
if (!isset($descs[$this->module])) {
$info = $this->moduleExtensionList
->getExtensionInfo($this->module);
$descs[$this->module] = $info && !empty($info['description']) ? $info['description'] : '';
}
return $descs[$this->module];
}
/**
* Initialize progress.
*/
public function initializeProgress() {
return $this
->getPlugin('launcher')
->initializeProgress($this);
}
/**
* Finish progress.
*/
public function finishProgress() {
return $this
->getPlugin('launcher')
->finishProgress($this);
}
/**
* Get job progress.
*
* @return float
* The progress of this job.
*/
public function getProgress() {
return $this
->getPlugin('launcher')
->getProgress($this);
}
/**
* Get multiple job progresses.
*
* @param array $jobs
* Jobs to get progress for.
*
* @return array
* Progress of jobs, keyed by job name.
*/
public static function getProgressMultiple($jobs) {
$launchers = array();
foreach ($jobs as $job) {
$launchers[$job
->getPlugin('launcher')->name][$job
->id()] = $job;
}
$progresses = array();
foreach ($launchers as $launcher => $jobs) {
$progresses += ultimate_cron_plugin_load('launcher', $launcher)
->getProgressMultiple($jobs);
}
return $progresses;
}
/**
* Set job progress.
*
* @param float $progress
* The progress (0 - 1).
*/
public function setProgress($progress) {
if ($this
->getPlugin('launcher')
->setProgress($this, $progress)) {
$this
->sendMessage('setProgress', array(
'progress' => $progress,
));
return TRUE;
}
return FALSE;
}
/**
* Format progress.
*
* @param float $progress
* (optional) The progress to format. Uses the progress on the object
* if not specified.
*
* @return string
* Formatted progress.
*/
public function formatProgress($progress = NULL) {
if (!isset($progress)) {
$progress = isset($this->progress) ? $this->progress : $this
->getProgress();
}
return $this
->getPlugin('launcher')
->formatProgress($this, $progress);
}
/**
* Get a "unique" id for a job.
*/
public function getUniqueID() {
return isset($this->ids[$this
->id()]) ? $this->ids[$this
->id()] : ($this->ids[$this
->id()] = hexdec(substr(sha1($this
->id()), -8)));
}
/**
* Send a nodejs message.
*
* @param string $action
* The action performed.
* @param array $data
* Data blob for the given action.
*/
public function sendMessage($action, $data = array()) {
// @TODO: Nodejs integration has not been ported to 8.x yet.
if (FALSE && \Drupal::moduleHandler()
->moduleExists('nodejs')) {
$settings = ultimate_cron_plugin_load('settings', 'general')
->getDefaultSettings();
if (empty($settings['nodejs'])) {
return;
}
$elements = array();
$build = clone $this;
$cell_idxs = array();
switch ($action) {
case 'lock':
$logger = $build
->getPlugin('logger');
if (empty($data['log_entry'])) {
$build->lock_id = $data['lock_id'];
$build->log_entry = $logger
->factoryLogEntry($build->name);
$build->log_entry
->setData(array(
'lid' => $data['lock_id'],
'start_time' => microtime(TRUE),
));
}
else {
$build->log_entry = $data['log_entry'];
}
$cell_idxs = array(
'tr#' . $build->name . ' .ctools-export-ui-start-time' => 3,
'tr#' . $build->name . ' .ctools-export-ui-duration' => 4,
'tr#' . $build->name . ' .ctools-export-ui-status' => 5,
'tr#' . $build->name . ' .ctools-export-ui-operations' => 7,
);
break;
case 'unlock':
$build->log_entry = $build
->loadLogEntry($data['lock_id']);
$build->lock_id = FALSE;
$cell_idxs = array(
'tr#' . $build->name . ' .ctools-export-ui-start-time' => 3,
'tr#' . $build->name . ' .ctools-export-ui-duration' => 4,
'tr#' . $build->name . ' .ctools-export-ui-status' => 5,
'tr#' . $build->name . ' .ctools-export-ui-operations' => 7,
);
break;
case 'setProgress':
$build->lock_id = $build
->isLocked();
$build->log_entry = $build
->loadLogEntry($build->lock_id);
$cell_idxs = array(
'tr#' . $build->name . ' .ctools-export-ui-start-time' => 3,
'tr#' . $build->name . ' .ctools-export-ui-duration' => 4,
'tr#' . $build->name . ' .ctools-export-ui-status' => 5,
);
break;
}
$cells = $build
->rebuild_ctools_export_ui_table_row();
foreach ($cell_idxs as $selector => $cell_idx) {
$elements[$selector] = $cells[$cell_idx];
}
$message = (object) array(
'channel' => 'ultimate_cron',
'data' => (object) array(
'action' => $action,
'job' => $build,
'timestamp' => microtime(TRUE),
'elements' => $elements,
),
'callback' => 'nodejsUltimateCron',
);
nodejs_send_content_channel_message($message);
}
}
/**
* {@inheritdoc}
*/
public function calculateDependencies() {
parent::calculateDependencies();
$this
->addDependency('module', $this
->getModule());
return $this->dependencies;
}
/**
* {@inheritdoc}
*/
public function getTitle() {
return $this->title;
}
/**
* {@inheritdoc}
*/
public function getCallback() {
if (is_callable($this->callback)) {
return $this->callback;
}
else {
return $this
->resolveCallback($this->callback);
}
}
/**
* {@inheritdoc}
*/
public function getModule() {
return $this->module;
}
/**
* {@inheritdoc}
*/
public function getSchedulerId() {
return $this->scheduler;
}
/**
* {@inheritdoc}
*/
public function getLauncherId() {
return $this->launcher['id'];
}
/**
* {@inheritdoc}
*/
public function getLoggerId() {
return $this->logger['id'];
}
/**
* {@inheritdoc}
*/
public function setTitle($title) {
$this
->set('title', $title);
return $this;
}
/**
* {@inheritdoc}
*/
public function setCallback($callback) {
$this
->set('callback', $callback);
return $this;
}
/**
* {@inheritdoc}
*/
public function setModule($module) {
$this
->set('module', $module);
return $this;
}
/**
* {@inheritdoc}
*/
public function setSchedulerId($scheduler_id) {
$this->scheduler['id'] = $scheduler_id;
return $this;
}
/**
* {@inheritdoc}
*/
public function setLauncherId($launcher_id) {
$this->launcher['id'] = $launcher_id;
return $this;
}
/**
* {@inheritdoc}
*/
public function setLoggerId($logger_id) {
$this->logger['id'] = $logger_id;
return $this;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CacheableDependencyTrait:: |
protected | property | Cache contexts. | |
CacheableDependencyTrait:: |
protected | property | Cache max-age. | |
CacheableDependencyTrait:: |
protected | property | Cache tags. | |
CacheableDependencyTrait:: |
protected | function | Sets cacheability; useful for value object constructors. | |
ConfigEntityBase:: |
private | property | Whether the config is being deleted by the uninstall process. | |
ConfigEntityBase:: |
protected | property | The language code of the entity's default language. | |
ConfigEntityBase:: |
protected | property | The original ID of the configuration entity. | |
ConfigEntityBase:: |
protected | property | Third party entity settings. | |
ConfigEntityBase:: |
protected | property | Trust supplied data and not use configuration schema on save. | |
ConfigEntityBase:: |
protected | property | Information maintained by Drupal core about configuration. | |
ConfigEntityBase:: |
protected | function | Overrides \Drupal\Core\Entity\DependencyTrait:addDependency(). | |
ConfigEntityBase:: |
public | function |
Creates a duplicate of the entity. Overrides EntityBase:: |
1 |
ConfigEntityBase:: |
public | function |
Disables the configuration entity. Overrides ConfigEntityInterface:: |
1 |
ConfigEntityBase:: |
public | function |
Enables the configuration entity. Overrides ConfigEntityInterface:: |
|
ConfigEntityBase:: |
public | function |
Returns the value of a property. Overrides ConfigEntityInterface:: |
|
ConfigEntityBase:: |
public | function |
Returns the cache tags that should be used to invalidate caches. Overrides EntityBase:: |
1 |
ConfigEntityBase:: |
public | function |
Gets the configuration dependency name. Overrides EntityBase:: |
|
ConfigEntityBase:: |
protected static | function | Gets the configuration manager. | |
ConfigEntityBase:: |
public | function |
Gets the configuration target identifier for the entity. Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Gets the configuration dependencies. Overrides ConfigEntityInterface:: |
|
ConfigEntityBase:: |
public | function |
Gets the original ID. Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Gets the list of third parties that store information. Overrides ThirdPartySettingsInterface:: |
|
ConfigEntityBase:: |
public | function |
Gets the value of a third-party setting. Overrides ThirdPartySettingsInterface:: |
|
ConfigEntityBase:: |
public | function |
Gets all third-party settings of a given module. Overrides ThirdPartySettingsInterface:: |
|
ConfigEntityBase:: |
protected | function | Gets the typed config manager. | |
ConfigEntityBase:: |
public | function |
Gets whether on not the data is trusted. Overrides ConfigEntityInterface:: |
|
ConfigEntityBase:: |
protected static | function |
Override to never invalidate the individual entities' cache tags; the
config system already invalidates them. Overrides EntityBase:: |
|
ConfigEntityBase:: |
protected | function |
Override to never invalidate the entity's cache tag; the config system
already invalidates it. Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Checks whether this entity is installable. Overrides ConfigEntityInterface:: |
2 |
ConfigEntityBase:: |
public | function |
Overrides Entity::isNew(). Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Returns whether this entity is being changed during the uninstall process. Overrides ConfigEntityInterface:: |
|
ConfigEntityBase:: |
public | function |
Deprecated way of generating a link to the entity. See toLink(). Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Informs the entity that entities it depends on will be deleted. Overrides ConfigEntityInterface:: |
7 |
ConfigEntityBase:: |
public static | function |
Acts on entities before they are deleted and before hooks are invoked. Overrides EntityBase:: |
8 |
ConfigEntityBase:: |
public | function |
Acts on an entity before the presave hook is invoked. Overrides EntityBase:: |
13 |
ConfigEntityBase:: |
public | function |
Saves an entity permanently. Overrides EntityBase:: |
1 |
ConfigEntityBase:: |
public | function |
Sets the value of a property. Overrides ConfigEntityInterface:: |
|
ConfigEntityBase:: |
public | function |
Sets the original ID. Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Sets the status of the configuration entity. Overrides ConfigEntityInterface:: |
|
ConfigEntityBase:: |
public | function |
Sets the value of a third-party setting. Overrides ThirdPartySettingsInterface:: |
|
ConfigEntityBase:: |
public | function | ||
ConfigEntityBase:: |
public static | function | Helper callback for uasort() to sort configuration entities by weight and label. | 6 |
ConfigEntityBase:: |
public | function |
Returns whether the configuration entity is enabled. Overrides ConfigEntityInterface:: |
4 |
ConfigEntityBase:: |
public | function |
Gets an array of all property values. Overrides EntityBase:: |
2 |
ConfigEntityBase:: |
public | function |
Gets the URL object for the entity. Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Sets that the data should be trusted. Overrides ConfigEntityInterface:: |
|
ConfigEntityBase:: |
public | function |
Unsets a third-party setting. Overrides ThirdPartySettingsInterface:: |
|
ConfigEntityBase:: |
public | function |
Gets the public URL for this entity. Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Gets the URL object for the entity. Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Overrides EntityBase:: |
4 |
CronJob:: |
protected | property | ||
CronJob:: |
protected | property | The class resolver. | |
CronJob:: |
public static | property | ||
CronJob:: |
protected | property | ||
CronJob:: |
protected | property | ||
CronJob:: |
protected | property | ||
CronJob:: |
protected | property | ||
CronJob:: |
protected | property | The module extension list service. | |
CronJob:: |
protected | property | ||
CronJob:: |
public | property | ||
CronJob:: |
protected | property | ||
CronJob:: |
public | property | ||
CronJob:: |
public static | property | ||
CronJob:: |
protected | property |
Overrides ConfigEntityBase:: |
|
CronJob:: |
protected | property | ||
CronJob:: |
protected | property |
Overrides ConfigEntityBase:: |
|
CronJob:: |
protected | property | The weight. | |
CronJob:: |
public | function |
Calculates dependencies and stores them in the dependency property. Overrides ConfigEntityBase:: |
|
CronJob:: |
public | function |
Clear a signal. Overrides CronJobInterface:: |
|
CronJob:: |
public | function |
Send all signal for the job. Overrides CronJobInterface:: |
|
CronJob:: |
public | function |
Finish progress. Overrides CronJobInterface:: |
|
CronJob:: |
public | function |
Format progress. Overrides CronJobInterface:: |
|
CronJob:: |
public | function |
Gets the cron job callback string. Overrides CronJobInterface:: |
|
CronJob:: |
public | function | Gets this plugin's configuration. | |
CronJob:: |
public | function |
Gets launcher array which holds info about the launcher settings. Overrides CronJobInterface:: |
|
CronJob:: |
public | function |
Get log entries. Overrides CronJobInterface:: |
|
CronJob:: |
public | function |
Gets logger array which holds info about the logger settings. Overrides CronJobInterface:: |
|
CronJob:: |
public | function |
Gets the cron job module name used for the callback string. Overrides CronJobInterface:: |
|
CronJob:: |
public | function |
Get module description for this job. Overrides CronJobInterface:: |
|
CronJob:: |
public | function |
Get module name for this job. Overrides CronJobInterface:: |
|
CronJob:: |
public | function |
Get job plugin. Overrides CronJobInterface:: |
|
CronJob:: |
public | function |
Get job progress. Overrides CronJobInterface:: |
|
CronJob:: |
public static | function |
Get multiple job progresses. Overrides CronJobInterface:: |
|
CronJob:: |
public | function |
Gets scheduler array which holds info about the scheduler settings. Overrides CronJobInterface:: |
|
CronJob:: |
public | function |
Get a signal and clear it if found. Overrides CronJobInterface:: |
|
CronJob:: |
public | function |
Gets the title of the created cron job. Overrides CronJobInterface:: |
|
CronJob:: |
public | function |
Get a "unique" id for a job. Overrides CronJobInterface:: |
|
CronJob:: |
public | function |
Initialize progress. Overrides CronJobInterface:: |
|
CronJob:: |
protected | function | Invokes the jobs callback. | |
CronJob:: |
public | function |
Check if job is behind its schedule. Overrides CronJobInterface:: |
|
CronJob:: |
public | function |
Get locked state of job. Overrides CronJobInterface:: |
|
CronJob:: |
public static | function |
Get locked state for multiple jobs. Overrides CronJobInterface:: |
|
CronJob:: |
public | function |
Check job schedule. Overrides CronJobInterface:: |
|
CronJob:: |
public | function |
Check if the cron job is callable. Overrides CronJobInterface:: |
|
CronJob:: |
public static | function |
Load latest log entries. Overrides CronJobInterface:: |
|
CronJob:: |
public | function |
Load latest log. Overrides CronJobInterface:: |
|
CronJob:: |
public | function |
Load log entry. Overrides CronJobInterface:: |
|
CronJob:: |
public | function |
Lock job. Overrides CronJobInterface:: |
|
CronJob:: |
public | function |
Get a signal without affecting it. Overrides CronJobInterface:: |
|
CronJob:: |
public static | function |
Acts on deleted entities before the delete hook is invoked. Overrides EntityBase:: |
|
CronJob:: |
public | function |
Acts on a saved entity before the insert or update hook is invoked. Overrides EntityBase:: |
|
CronJob:: |
protected | function | Returns a callable for the given controller. | |
CronJob:: |
public | function |
Resume a previosly saved log. Overrides CronJobInterface:: |
|
CronJob:: |
public | function |
Run job. Overrides CronJobInterface:: |
|
CronJob:: |
public | function | Send a nodejs message. | |
CronJob:: |
public | function |
Send a signal. Overrides CronJobInterface:: |
|
CronJob:: |
public | function |
Sets the cron job callback string. Overrides CronJobInterface:: |
|
CronJob:: |
public | function | Set configuration for a given plugin type. | |
CronJob:: |
public | function |
Sets launcher array which holds info about the launcher settings. Overrides CronJobInterface:: |
|
CronJob:: |
public | function |
Sets logger array which holds info about the logger settings. Overrides CronJobInterface:: |
|
CronJob:: |
public | function |
Sets the cron job module name used for the callback string. Overrides CronJobInterface:: |
|
CronJob:: |
public | function |
Set job progress. Overrides CronJobInterface:: |
|
CronJob:: |
public | function |
Sets scheduler array which holds info about the scheduler settings. Overrides CronJobInterface:: |
|
CronJob:: |
public | function |
Sets the title of the created cron job. Overrides CronJobInterface:: |
|
CronJob:: |
public | function | Signal page for plugins. | |
CronJob:: |
public | function |
Start logging. Overrides CronJobInterface:: |
|
CronJob:: |
public | function |
Unlock job. Overrides CronJobInterface:: |
|
CronJob:: |
public | function |
CronJob constructor. Overrides ConfigEntityBase:: |
|
CronJobInterface:: |
constant | Cron job ID prefix for queue jobs. | ||
DependencySerializationTrait:: |
protected | property | An array of entity type IDs keyed by the property name of their storages. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | Aliased as: traitSleep | 1 |
DependencySerializationTrait:: |
public | function | 2 | |
DependencyTrait:: |
protected | property | The object's dependencies. | |
DependencyTrait:: |
protected | function | Adds multiple dependencies. | |
DependencyTrait:: |
protected | function | Adds a dependency. Aliased as: addDependencyTrait | |
EntityBase:: |
protected | property | Boolean indicating whether the entity should be forced to be new. | |
EntityBase:: |
protected | property | The entity type. | |
EntityBase:: |
protected | property | A typed data object wrapping this entity. | |
EntityBase:: |
public | function |
Checks data value access. Overrides AccessibleInterface:: |
1 |
EntityBase:: |
public | function |
Gets the bundle of the entity. Overrides EntityInterface:: |
1 |
EntityBase:: |
public static | function |
Constructs a new entity object, without permanently saving it. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Deletes an entity permanently. Overrides EntityInterface:: |
2 |
EntityBase:: |
public | function |
Enforces an entity to be new. Overrides EntityInterface:: |
|
EntityBase:: |
protected | function | Gets the entity manager. | |
EntityBase:: |
protected | function | Gets the entity type bundle info service. | |
EntityBase:: |
protected | function | Gets the entity type manager. | |
EntityBase:: |
public | function |
The cache contexts associated with this object. Overrides CacheableDependencyTrait:: |
|
EntityBase:: |
public | function |
The maximum age for which this object may be cached. Overrides CacheableDependencyTrait:: |
|
EntityBase:: |
public | function |
The cache tags associated with this object. Overrides CacheableDependencyTrait:: |
|
EntityBase:: |
public | function |
Gets the key that is used to store configuration dependencies. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Gets the entity type definition. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Gets the ID of the type of the entity. Overrides EntityInterface:: |
|
EntityBase:: |
protected | function | The list cache tags to invalidate for this entity. | |
EntityBase:: |
public | function |
Gets a typed data object for this entity object. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Indicates if a link template exists for a given key. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Gets the identifier. Overrides EntityInterface:: |
11 |
EntityBase:: |
public | function |
Gets the label of the entity. Overrides EntityInterface:: |
6 |
EntityBase:: |
public | function |
Gets the language of the entity. Overrides EntityInterface:: |
1 |
EntityBase:: |
protected | function | Gets the language manager. | |
EntityBase:: |
protected | function | Gets an array link templates. | 1 |
EntityBase:: |
public static | function |
Loads an entity. Overrides EntityInterface:: |
|
EntityBase:: |
public static | function |
Loads one or more entities. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Acts on a created entity before hooks are invoked. Overrides EntityInterface:: |
4 |
EntityBase:: |
public static | function |
Acts on loaded entities. Overrides EntityInterface:: |
2 |
EntityBase:: |
public static | function |
Changes the values of an entity before it is created. Overrides EntityInterface:: |
5 |
EntityBase:: |
public | function |
Gets a list of entities referenced by this entity. Overrides EntityInterface:: |
1 |
EntityBase:: |
public | function |
Generates the HTML for a link to this entity. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Gets a list of URI relationships supported by this entity. Overrides EntityInterface:: |
|
EntityBase:: |
protected | function | Gets an array of placeholders for this entity. | 2 |
EntityBase:: |
public | function |
Gets the entity UUID (Universally Unique Identifier). Overrides EntityInterface:: |
1 |
EntityBase:: |
protected | function | Gets the UUID generator. | |
PluginDependencyTrait:: |
protected | function | Calculates and adds dependencies of a specific plugin instance. | 1 |
PluginDependencyTrait:: |
protected | function | Calculates and returns dependencies of a specific plugin instance. | |
PluginDependencyTrait:: |
protected | function | Wraps the module handler. | 1 |
PluginDependencyTrait:: |
protected | function | Wraps the theme handler. | 1 |
RefinableCacheableDependencyTrait:: |
public | function | 1 | |
RefinableCacheableDependencyTrait:: |
public | function | ||
RefinableCacheableDependencyTrait:: |
public | function | ||
RefinableCacheableDependencyTrait:: |
public | function | ||
SynchronizableEntityTrait:: |
protected | property | Whether this entity is being created, updated or deleted through a synchronization process. | |
SynchronizableEntityTrait:: |
public | function | ||
SynchronizableEntityTrait:: |
public | function |