You are here

interface WarmerInterface in Warmer 8

Same name and namespace in other branches
  1. 2.x src/Plugin/WarmerInterface.php \Drupal\warmer\Plugin\WarmerInterface

Hierarchy

Expanded class hierarchy of WarmerInterface

All classes that implement WarmerInterface

File

src/Plugin/WarmerInterface.php, line 7

Namespace

Drupal\warmer\Plugin
View source
interface WarmerInterface {

  /**
   * Returns the batch size for the warming operation.
   *
   * @return int
   *   The size.
   */
  public function getBatchSize();

  /**
   * Returns the frequency for the warming operation.
   *
   * @return int
   *   The frequency in seconds.
   */
  public function getFrequency();

  /**
   * Loads multiple items based on their IDs.
   *
   * @param array
   *   The item IDs.
   *
   * @return array
   *   The loaded items.
   */
  public function loadMultiple(array $ids = []);

  /**
   * Warms multiple items.
   *
   * @param array $items
   *   The items to warm.
   *
   * @return int
   *   The number of items that were successfully warmed.
   */
  public function warmMultiple(array $items = []);

  /**
   * Builds the next batch of IDs based on a position cursor.
   *
   * @param mixed $cursor
   *   The position of the last generate batch.
   *
   * @return array
   *   The array of item IDs.
   */
  public function buildIdsBatch($cursor);

  /**
   * Checks if the plugin should warm in this particular moment.
   *
   * @return bool
   *   TRUE if the warmer is active. FALSE otherwise.
   */
  public function isActive();

  /**
   * Marks a warmer as enqueued.
   *
   * @return bool
   *   TRUE if the warmer is active. FALSE otherwise.
   */
  public function markAsEnqueued();

  /**
   * Adds additional form elements to the configuration form.
   *
   * @param array $form
   *   The configuration form to alter for the this plugin settings.
   * @param \Drupal\Core\Form\SubformStateInterface $form_state
   *   The form state for the plugin settings.
   *
   * @return array
   *   The form with additional elements.
   */
  public function addMoreConfigurationFormElements(array $form, SubformStateInterface $form_state);

}

Members

Namesort descending Modifiers Type Description Overrides
WarmerInterface::addMoreConfigurationFormElements public function Adds additional form elements to the configuration form. 3
WarmerInterface::buildIdsBatch public function Builds the next batch of IDs based on a position cursor. 3
WarmerInterface::getBatchSize public function Returns the batch size for the warming operation. 1
WarmerInterface::getFrequency public function Returns the frequency for the warming operation. 1
WarmerInterface::isActive public function Checks if the plugin should warm in this particular moment. 1
WarmerInterface::loadMultiple public function Loads multiple items based on their IDs. 3
WarmerInterface::markAsEnqueued public function Marks a warmer as enqueued. 1
WarmerInterface::warmMultiple public function Warms multiple items. 3