You are here

public function UltimateCronJob::getPlugin in Ultimate Cron 7.2

Get job plugin.

If no plugin name is provided current plugin of the specified type will be returned.

Parameters

string $plugin_type: Name of plugin type.

string $name: (optional) The name of the plugin.

Return value

mixed Plugin instance of the specified type.

5 calls to UltimateCronJob::getPlugin()
UltimateCronJob::cron_alter in ./ultimate_cron.job.inc
Invoke plugin cron_alter().
UltimateCronJob::getPluginSettings in ./ultimate_cron.job.inc
Get plugin settings.
UltimateCronJob::lock in ./ultimate_cron.job.inc
Lock job.
UltimateCronJob::resumeLog in ./ultimate_cron.job.inc
Resume a previosly saved log.
UltimateCronJob::startLog in ./ultimate_cron.job.inc
Start logging.

File

./ultimate_cron.job.inc, line 183
Job class for Ultimate Cron.

Class

UltimateCronJob
Class for handling cron jobs.

Code

public function getPlugin($plugin_type, $name = NULL) {
  if ($name) {
    return _ultimate_cron_plugin_require($plugin_type, $name);
  }
  if (isset($this->plugins[$plugin_type])) {
    return $this->plugins[$plugin_type];
  }
  if ($name) {
  }
  elseif (!empty($this->settings[$plugin_type]['name'])) {
    $name = $this->settings[$plugin_type]['name'];
  }
  else {
    $name = $this->hook[$plugin_type]['name'];
  }
  $this->plugins[$plugin_type] = _ultimate_cron_plugin_require($plugin_type, $name);
  return $this->plugins[$plugin_type];
}