You are here

protected function CronJobDiscovery::getModuleHooks in Ultimate Cron 8.2

Get cron hooks declared by a module.

Parameters

string $module: Name of module.

Return value

array Hook definitions for the specified module.

1 call to CronJobDiscovery::getModuleHooks()
CronJobDiscovery::getHooks in src/CronJobDiscovery.php
Get all cron hooks defined.

File

src/CronJobDiscovery.php, line 179

Class

CronJobDiscovery
Discovery and instantiation of default cron jobs.

Namespace

Drupal\ultimate_cron

Code

protected function getModuleHooks($module) {
  $items = array();

  // Add hook_cron() if applicable.
  if ($this->moduleHandler
    ->implementsHook($module, 'cron')) {
    $info = $this->moduleExtensionList
      ->getExtensionInfo($module);
    $callback = "{$module}_cron";
    $items[$callback] = array(
      'module' => $module,
      'title' => isset($titles[$callback]) ? $titles[$callback] : 'Default cron handler',
      'configure' => empty($info['configure']) ? NULL : $info['configure'],
      'callback' => $callback,
      'tags' => array(),
      'pass job argument' => FALSE,
    );
    $items["{$module}_cron"]['tags'][] = 'core';
  }
  return $items;
}