You are here

public function NodeRevisionDelete::getContentTypeConfigWithRelativeTime in Node Revision Delete 8

Return the configuration for a content type with the relative time.

Parameters

string $content_type: Content type machine name.

Return value

array An array with the configuration for the content type.

Overrides NodeRevisionDeleteInterface::getContentTypeConfigWithRelativeTime

3 calls to NodeRevisionDelete::getContentTypeConfigWithRelativeTime()
NodeRevisionDelete::getCandidatesNodes in src/NodeRevisionDelete.php
Return the list of candidate nodes for node revision delete.
NodeRevisionDelete::getCandidatesRevisions in src/NodeRevisionDelete.php
Return the list of candidate revisions to be deleted.
NodeRevisionDelete::getCandidatesRevisionsByNids in src/NodeRevisionDelete.php
Return the candidate revisions to be deleted if a group of nids.

File

src/NodeRevisionDelete.php, line 426

Class

NodeRevisionDelete
Class NodeRevisionDelete.

Namespace

Drupal\node_revision_delete

Code

public function getContentTypeConfigWithRelativeTime($content_type) {

  // Getting the content type config.
  $content_type_config = $this
    ->getContentTypeConfig($content_type);
  if (!empty($content_type_config)) {

    // Getting the relative time for the minimum_age_to_delete.
    $content_type_config['minimum_age_to_delete'] = $this
      ->getRelativeTime('minimum_age_to_delete', $content_type_config['minimum_age_to_delete']);

    // Getting the relative time for the when_to_delete.
    $content_type_config['when_to_delete'] = $this
      ->getRelativeTime('when_to_delete', $content_type_config['when_to_delete']);
  }
  return $content_type_config;
}