You are here

interface NodeRevisionDeleteInterface in Node Revision Delete 8

Interface NodeRevisionDeleteInterface.

@package Drupal\node_revision_delete

Hierarchy

Expanded class hierarchy of NodeRevisionDeleteInterface

All classes that implement NodeRevisionDeleteInterface

7 files declare their use of NodeRevisionDeleteInterface
AdminSettingsForm.php in src/Form/AdminSettingsForm.php
CandidateNodesForm.php in src/Form/CandidateNodesForm.php
CandidateNodesRevisionsDeleteForm.php in src/Form/CandidateNodesRevisionsDeleteForm.php
CandidateRevisionsContentTypeForm.php in src/Form/CandidateRevisionsContentTypeForm.php
CandidateRevisionsNodeForm.php in src/Form/CandidateRevisionsNodeForm.php

... See full list

File

src/NodeRevisionDeleteInterface.php, line 10

Namespace

Drupal\node_revision_delete
View source
interface NodeRevisionDeleteInterface {

  /**
   * Update the max_number for a config name.
   *
   * We need to update the max_number in the existing content type configuration
   * if the new value (max_number) is lower than the actual, in this case the
   * new value will be the value for the content type.
   *
   * @param string $config_name
   *   Config name to update (when_to_delete or minimum_age_to_delete).
   * @param int $max_number
   *   The maximum number for $config_name parameter.
   */
  public function updateTimeMaxNumberConfig($config_name, $max_number);

  /**
   * Return the time string for the config_name parameter.
   *
   * @param string $config_name
   *   The config name (minimum_age_to_delete|when_to_delete).
   * @param int $number
   *   The number for the $config_name parameter configuration.
   *
   * @return string
   *   The time string for the $config_name parameter.
   */
  public function getTimeString($config_name, $number);

  /**
   * Save the content type config variable.
   *
   * @param string $content_type
   *   Content type machine name.
   * @param int $minimum_revisions_to_keep
   *   Minimum number of revisions to keep.
   * @param int $minimum_age_to_delete
   *   Minimum age in months of revision to delete.
   * @param int $when_to_delete
   *   Number of inactivity months to wait for delete a revision.
   */
  public function saveContentTypeConfig($content_type, $minimum_revisions_to_keep, $minimum_age_to_delete, $when_to_delete);

  /**
   * Delete the content type config variable.
   *
   * @param string $content_type
   *   Content type machine name.
   */
  public function deleteContentTypeConfig($content_type);

  /**
   * Return the available values for time frequency.
   *
   * @param string $index
   *   The index to retrieve.
   *
   * @return string|array
   *   The index value (human readable value).
   */
  public function getTimeValues($index = NULL);

  /**
   * Return the time option in singular or plural.
   *
   * @param string $number
   *   The number.
   * @param string $time
   *   The time option (days, weeks or months).
   *
   * @return string
   *   The singular or plural value for the time.
   */
  public function getTimeNumberString($number, $time);

  /**
   * Return the list of candidate nodes for node revision delete.
   *
   * @param string $content_type
   *   Content type machine name.
   *
   * @return array
   *   Array of nids.
   */
  public function getCandidatesNodes($content_type);

  /**
   * Get all revision that are older than current deleted revision.
   *
   * The revisions should have the same language as the current language of the
   * page.
   *
   * @param int $nid
   *   The node id.
   * @param int $currently_deleted_revision_id
   *   The current revision.
   *
   * @return array
   *   An array with the previous revisions.
   */
  public function getPreviousRevisions($nid, $currently_deleted_revision_id);

  /**
   * Return the list of candidate revisions to be deleted.
   *
   * @param string $content_type
   *   Content type machine name.
   * @param int $number
   *   The number of revisions to return.
   *
   * @return array
   *   Array of vids.
   */
  public function getCandidatesRevisions($content_type, $number = PHP_INT_MAX);

  /**
   * Determine the time value for a node type and a variable type.
   *
   * @param string $config_name
   *   The config name, can by minimum_age_to_delete or when_to_delete.
   * @param int $number
   *   The number representing the variable type.
   *
   * @return int
   *   The timestamp representing the relative time for the node type variable.
   */
  public function getRelativeTime($config_name, $number);

  /**
   * Return the configuration for a content type.
   *
   * @param string $content_type
   *   Content type machine name.
   *
   * @return array
   *   An array with the configuration for the content type.
   */
  public function getContentTypeConfig($content_type);

  /**
   * Return the configuration for a content type with the relative time.
   *
   * @param string $content_type
   *   Content type machine name.
   *
   * @return array
   *   An array with the configuration for the content type.
   */
  public function getContentTypeConfigWithRelativeTime($content_type);

  /**
   * Get the content types configured for node revision delete.
   *
   * @return array
   *   An array with the configured content types objects.
   */
  public function getConfiguredContentTypes();

  /**
   * Return a number of candidate revisions to be deleted.
   *
   * @param int $number
   *   The number of revisions to return.
   *
   * @return array
   *   Array of vids.
   */
  public function getCandidatesRevisionsByNumber($number);

  /**
   * Return the revision deletion batch definition.
   *
   * @param array $revisions
   *   The revisions array.
   * @param bool $dry_run
   *   The dry run option.
   *
   * @return array
   *   The batch definition.
   */
  public function getRevisionDeletionBatch(array $revisions, $dry_run);

  /**
   * Return the candidate revisions to be deleted if a group of nids.
   *
   * All the nids must be of the same content type.
   *
   * @param array $nids
   *   The nids.
   *
   * @return array
   *   Array of vids.
   */
  public function getCandidatesRevisionsByNids(array $nids);

}

Members

Namesort descending Modifiers Type Description Overrides
NodeRevisionDeleteInterface::deleteContentTypeConfig public function Delete the content type config variable. 1
NodeRevisionDeleteInterface::getCandidatesNodes public function Return the list of candidate nodes for node revision delete. 1
NodeRevisionDeleteInterface::getCandidatesRevisions public function Return the list of candidate revisions to be deleted. 1
NodeRevisionDeleteInterface::getCandidatesRevisionsByNids public function Return the candidate revisions to be deleted if a group of nids. 1
NodeRevisionDeleteInterface::getCandidatesRevisionsByNumber public function Return a number of candidate revisions to be deleted. 1
NodeRevisionDeleteInterface::getConfiguredContentTypes public function Get the content types configured for node revision delete. 1
NodeRevisionDeleteInterface::getContentTypeConfig public function Return the configuration for a content type. 1
NodeRevisionDeleteInterface::getContentTypeConfigWithRelativeTime public function Return the configuration for a content type with the relative time. 1
NodeRevisionDeleteInterface::getPreviousRevisions public function Get all revision that are older than current deleted revision. 1
NodeRevisionDeleteInterface::getRelativeTime public function Determine the time value for a node type and a variable type. 1
NodeRevisionDeleteInterface::getRevisionDeletionBatch public function Return the revision deletion batch definition. 1
NodeRevisionDeleteInterface::getTimeNumberString public function Return the time option in singular or plural. 1
NodeRevisionDeleteInterface::getTimeString public function Return the time string for the config_name parameter. 1
NodeRevisionDeleteInterface::getTimeValues public function Return the available values for time frequency. 1
NodeRevisionDeleteInterface::saveContentTypeConfig public function Save the content type config variable. 1
NodeRevisionDeleteInterface::updateTimeMaxNumberConfig public function Update the max_number for a config name. 1