You are here

interface CronJobInterface in Ultimate Cron 8.2

Hierarchy

Expanded class hierarchy of CronJobInterface

All classes that implement CronJobInterface

7 files declare their use of CronJobInterface
CronJob.php in src/Entity/CronJob.php
Crontab.php in src/Plugin/ultimate_cron/Scheduler/Crontab.php
DatabaseLogger.php in src/Plugin/ultimate_cron/Logger/DatabaseLogger.php
LauncherBase.php in src/Launcher/LauncherBase.php
LauncherInterface.php in src/Launcher/LauncherInterface.php

... See full list

File

src/CronJobInterface.php, line 9

Namespace

Drupal\ultimate_cron
View source
interface CronJobInterface extends ConfigEntityInterface {

  /**
   * Cron job ID prefix for queue jobs.
   */
  const QUEUE_ID_PREFIX = 'ultimate_cron_queue_';

  /**
   * Get locked state for multiple jobs.
   *
   * @param array $jobs
   *   Jobs to check locks for.
   */
  public static function isLockedMultiple($jobs);

  /**
   * 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,
  ));

  /**
   * 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);

  /**
   * Gets the title of the created cron job.
   *
   * @return mixed
   *  Cron job title.
   */
  public function getTitle();

  /**
   * Gets the cron job callback string.
   *
   * @return string
   *  Callback string.
   */
  public function getCallback();

  /**
   * Gets the cron job module name used for the callback string.
   *
   * @return string
   *  Module name.
   */
  public function getModule();

  /**
   * Gets scheduler array which holds info about the scheduler settings.
   *
   * @return array
   *  Scheduler settings
   */
  public function getSchedulerId();

  /**
   * Gets launcher array which holds info about the launcher settings.
   *
   * @return array
   *  Launcher settings
   */
  public function getLauncherId();

  /**
   * Gets logger array which holds info about the logger settings.
   *
   * @return array
   *  Logger settings
   */
  public function getLoggerId();

  /**
   * Sets the title of the created cron job.
   *
   * @param $title
   * @return mixed
   *  Cron job title.
   */
  public function setTitle($title);

  /**
   * Sets the cron job callback string.
   *
   * @param $callback
   * @return string
   *  Callback string.
   */
  public function setCallback($callback);

  /**
   * Sets the cron job module name used for the callback string.
   *
   * @param $module
   * @return string
   *  Module name.
   */
  public function setModule($module);

  /**
   * Sets scheduler array which holds info about the scheduler settings.
   *
   * @param $scheduler_id
   * @return array
   *  Scheduler settings
   */
  public function setSchedulerId($scheduler_id);

  /**
   * Sets launcher array which holds info about the launcher settings.
   *
   * @param $launcher_id
   * @return array
   *  Launcher settings
   */
  public function setLauncherId($launcher_id);

  /**
   * Sets logger array which holds info about the logger settings.
   *
   * @param $logger_id
   * @return array
   *  Logger settings
   */
  public function setLoggerId($logger_id);

  /**
   * Check if the cron job is callable.
   *
   * @return bool
   *   TRUE if the job is callable, FALSE otherwise.
   */
  public function isValid();

  /**
   * Get a signal without affecting it.
   *
   * @see UltimateCronSignal::peek()
   */
  public function peekSignal($signal);

  /**
   * Get a signal and clear it if found.
   *
   * @see UltimateCronSignal::get()
   */
  public function getSignal($signal);

  /**
   * Send a signal.
   *
   * @see UltimateCronSignal::set()
   */
  public function sendSignal($signal, $persist = FALSE);

  /**
   * Clear a signal.
   *
   * @see UltimateCronSignal::clear()
   */
  public function clearSignal($signal);

  /**
   * Send all signal for the job.
   *
   * @see UltimateCronSignal::flush()
   */
  public function clearSignals();

  /**
   * Check job schedule.
   */
  public function isScheduled();

  /**
   * Check if job is behind its schedule.
   */
  public function isBehindSchedule();

  /**
   * Lock job.
   */
  public function lock();

  /**
   * Unlock job.
   *
   * @param string $lock_id
   *   The lock id to unlock.
   * @param boolean $manual
   *   Whether or not this is a manual unlock.
   */
  public function unlock($lock_id = NULL, $manual = FALSE);

  /**
   * Get locked state of job.
   */
  public function isLocked();

  /**
   * Run job.
   *
   * @param string $init_message
   *   (optional) The launch message. If left NULL, a default message will be
   *   displayed.
   *
   * @return bool
   *   TRUE if the job is ran, FALSE otherwise.
   */
  public function run($init_message = NULL);

  /**
   * Get log entries.
   *
   * @param integer $limit
   *   (optional) Number of log entries per page.
   *
   * @return array
   *   Array of UltimateCronLogEntry objects.
   */
  public function getLogEntries($log_types = ULTIMATE_CRON_LOG_TYPE_ALL, $limit = 10);

  /**
   * Load log entry.
   *
   * @param string $lock_id
   *   The lock id of the log entry.
   *
   * @return LogEntry
   *   The log entry.
   */
  public function loadLogEntry($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,
  ));

  /**
   * Start logging.
   *
   * @param string $lock_id
   *   The lock id to use.
   * @param string $init_message
   *   Initial message for the log.
   *
   * @return \Drupal\ultimate_cron\Logger\LogEntry
   *   The log object.
   */
  public function startLog($lock_id, $init_message = '', $log_type = ULTIMATE_CRON_LOG_TYPE_NORMAL);

  /**
   * 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);

  /**
   * Get module name for this job.
   */
  public function getModuleName();

  /**
   * Get module description for this job.
   */
  public function getModuleDescription();

  /**
   * Initialize progress.
   */
  public function initializeProgress();

  /**
   * Finish progress.
   */
  public function finishProgress();

  /**
   * Get job progress.
   *
   * @return float
   *   The progress of this job.
   */
  public function getProgress();

  /**
   * Set job progress.
   *
   * @param float $progress
   *   The progress (0 - 1).
   */
  public function setProgress($progress);

  /**
   * 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);

  /**
   * Get a "unique" id for a job.
   */
  public function getUniqueID();

  /**
   * 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 \Drupal\ultimate_cron\CronPlugin
   *   Plugin instance of the specified type.
   */
  public function getPlugin($plugin_type, $name = NULL);

}

Members

Namesort descending Modifiers Type Description Overrides
AccessibleInterface::access public function Checks data value access. 9
CacheableDependencyInterface::getCacheContexts public function The cache contexts associated with this object. 34
CacheableDependencyInterface::getCacheMaxAge public function The maximum age for which this object may be cached. 34
CacheableDependencyInterface::getCacheTags public function The cache tags associated with this object. 27
ConfigEntityInterface::calculateDependencies public function Calculates dependencies and stores them in the dependency property. 2
ConfigEntityInterface::disable public function Disables the configuration entity. 2
ConfigEntityInterface::enable public function Enables the configuration entity. 2
ConfigEntityInterface::get public function Returns the value of a property. 2
ConfigEntityInterface::getDependencies public function Gets the configuration dependencies. 2
ConfigEntityInterface::hasTrustedData public function Gets whether on not the data is trusted. 2
ConfigEntityInterface::isInstallable public function Checks whether this entity is installable. 2
ConfigEntityInterface::isUninstalling public function Returns whether this entity is being changed during the uninstall process. 2
ConfigEntityInterface::onDependencyRemoval public function Informs the entity that entities it depends on will be deleted. 2
ConfigEntityInterface::set public function Sets the value of a property. 2
ConfigEntityInterface::setStatus public function Sets the status of the configuration entity. 2
ConfigEntityInterface::status public function Returns whether the configuration entity is enabled. 2
ConfigEntityInterface::trustData public function Sets that the data should be trusted. 2
CronJobInterface::clearSignal public function Clear a signal. 1
CronJobInterface::clearSignals public function Send all signal for the job. 1
CronJobInterface::finishProgress public function Finish progress. 1
CronJobInterface::formatProgress public function Format progress. 1
CronJobInterface::getCallback public function Gets the cron job callback string. 1
CronJobInterface::getLauncherId public function Gets launcher array which holds info about the launcher settings. 1
CronJobInterface::getLogEntries public function Get log entries. 1
CronJobInterface::getLoggerId public function Gets logger array which holds info about the logger settings. 1
CronJobInterface::getModule public function Gets the cron job module name used for the callback string. 1
CronJobInterface::getModuleDescription public function Get module description for this job. 1
CronJobInterface::getModuleName public function Get module name for this job. 1
CronJobInterface::getPlugin public function Get job plugin. 1
CronJobInterface::getProgress public function Get job progress. 1
CronJobInterface::getProgressMultiple public static function Get multiple job progresses. 1
CronJobInterface::getSchedulerId public function Gets scheduler array which holds info about the scheduler settings. 1
CronJobInterface::getSignal public function Get a signal and clear it if found. 1
CronJobInterface::getTitle public function Gets the title of the created cron job. 1
CronJobInterface::getUniqueID public function Get a "unique" id for a job. 1
CronJobInterface::initializeProgress public function Initialize progress. 1
CronJobInterface::isBehindSchedule public function Check if job is behind its schedule. 1
CronJobInterface::isLocked public function Get locked state of job. 1
CronJobInterface::isLockedMultiple public static function Get locked state for multiple jobs. 1
CronJobInterface::isScheduled public function Check job schedule. 1
CronJobInterface::isValid public function Check if the cron job is callable. 1
CronJobInterface::loadLatestLogEntries public static function Load latest log entries. 1
CronJobInterface::loadLatestLogEntry public function Load latest log. 1
CronJobInterface::loadLogEntry public function Load log entry. 1
CronJobInterface::lock public function Lock job. 1
CronJobInterface::peekSignal public function Get a signal without affecting it. 1
CronJobInterface::QUEUE_ID_PREFIX constant Cron job ID prefix for queue jobs.
CronJobInterface::resumeLog public function Resume a previosly saved log. 1
CronJobInterface::run public function Run job. 1
CronJobInterface::sendSignal public function Send a signal. 1
CronJobInterface::setCallback public function Sets the cron job callback string. 1
CronJobInterface::setLauncherId public function Sets launcher array which holds info about the launcher settings. 1
CronJobInterface::setLoggerId public function Sets logger array which holds info about the logger settings. 1
CronJobInterface::setModule public function Sets the cron job module name used for the callback string. 1
CronJobInterface::setProgress public function Set job progress. 1
CronJobInterface::setSchedulerId public function Sets scheduler array which holds info about the scheduler settings. 1
CronJobInterface::setTitle public function Sets the title of the created cron job. 1
CronJobInterface::startLog public function Start logging. 1
CronJobInterface::unlock public function Unlock job. 1
EntityInterface::bundle public function Gets the bundle of the entity. 2
EntityInterface::create public static function Constructs a new entity object, without permanently saving it. 2
EntityInterface::createDuplicate public function Creates a duplicate of the entity. 2
EntityInterface::delete public function Deletes an entity permanently. 2
EntityInterface::enforceIsNew public function Enforces an entity to be new. 2
EntityInterface::getCacheTagsToInvalidate public function Returns the cache tags that should be used to invalidate caches. 2
EntityInterface::getConfigDependencyKey public function Gets the key that is used to store configuration dependencies. 2
EntityInterface::getConfigDependencyName public function Gets the configuration dependency name. 2
EntityInterface::getConfigTarget public function Gets the configuration target identifier for the entity. 2
EntityInterface::getEntityType public function Gets the entity type definition. 2
EntityInterface::getEntityTypeId public function Gets the ID of the type of the entity. 2
EntityInterface::getOriginalId public function Gets the original ID. 2
EntityInterface::getTypedData public function Gets a typed data object for this entity object. 2
EntityInterface::hasLinkTemplate public function Indicates if a link template exists for a given key. 2
EntityInterface::id public function Gets the identifier. 2
EntityInterface::isNew public function Determines whether the entity is new. 2
EntityInterface::label public function Gets the label of the entity. 2
EntityInterface::language public function Gets the language of the entity. 2
EntityInterface::link Deprecated public function Deprecated way of generating a link to the entity. See toLink(). 2
EntityInterface::load public static function Loads an entity. 2
EntityInterface::loadMultiple public static function Loads one or more entities. 2
EntityInterface::postCreate public function Acts on a created entity before hooks are invoked. 2
EntityInterface::postDelete public static function Acts on deleted entities before the delete hook is invoked. 2
EntityInterface::postLoad public static function Acts on loaded entities. 3
EntityInterface::postSave public function Acts on a saved entity before the insert or update hook is invoked. 2
EntityInterface::preCreate public static function Changes the values of an entity before it is created. 2
EntityInterface::preDelete public static function Acts on entities before they are deleted and before hooks are invoked. 2
EntityInterface::preSave public function Acts on an entity before the presave hook is invoked. 2
EntityInterface::referencedEntities public function Gets a list of entities referenced by this entity. 2
EntityInterface::save public function Saves an entity permanently. 2
EntityInterface::setOriginalId public function Sets the original ID. 2
EntityInterface::toArray public function Gets an array of all property values. 3
EntityInterface::toLink public function Generates the HTML for a link to this entity. 2
EntityInterface::toUrl public function Gets the URL object for the entity. 2
EntityInterface::uriRelationships public function Gets a list of URI relationships supported by this entity. 2
EntityInterface::url Deprecated public function Gets the public URL for this entity. 2
EntityInterface::urlInfo Deprecated public function Gets the URL object for the entity. 2
EntityInterface::uuid public function Gets the entity UUID (Universally Unique Identifier). 2
RefinableCacheableDependencyInterface::addCacheableDependency public function Adds a dependency on an object: merges its cacheability metadata. 1
RefinableCacheableDependencyInterface::addCacheContexts public function Adds cache contexts. 1
RefinableCacheableDependencyInterface::addCacheTags public function Adds cache tags. 1
RefinableCacheableDependencyInterface::mergeCacheMaxAge public function Merges the maximum age (in seconds) with the existing maximum age. 1
SynchronizableInterface::isSyncing public function Returns whether this entity is being changed as part of a synchronization. 1
SynchronizableInterface::setSyncing public function Sets the status of the synchronization flag. 1
ThirdPartySettingsInterface::getThirdPartyProviders public function Gets the list of third parties that store information. 5
ThirdPartySettingsInterface::getThirdPartySetting public function Gets the value of a third-party setting. 5
ThirdPartySettingsInterface::getThirdPartySettings public function Gets all third-party settings of a given module. 5
ThirdPartySettingsInterface::setThirdPartySetting public function Sets the value of a third-party setting. 5
ThirdPartySettingsInterface::unsetThirdPartySetting public function Unsets a third-party setting. 5