You are here

protected function AcsfDuplicationScrubEntityHandler::getPreservedUsers in Acquia Cloud Site Factory Connector 8

Same name and namespace in other branches
  1. 8.2 src/Event/AcsfDuplicationScrubEntityHandler.php \Drupal\acsf\Event\AcsfDuplicationScrubEntityHandler::getPreservedUsers()

Gets a list of user IDs which should not be scrubbed.

This is a reference implementation for use by child classes; by default, it returns admins and the anonymous user.

Return value

array An indexed array of user IDs which should not be scrubbed.

2 calls to AcsfDuplicationScrubEntityHandler::getPreservedUsers()
AcsfDuplicationScrubNodeHandler::getPreservedUsers in src/Event/AcsfDuplicationScrubNodeHandler.php
Gets a list of user IDs which should not be scrubbed.
AcsfDuplicationScrubUserHandler::getBaseQuery in src/Event/AcsfDuplicationScrubUserHandler.php
Gets an initialized entity query instance.
1 method overrides AcsfDuplicationScrubEntityHandler::getPreservedUsers()
AcsfDuplicationScrubNodeHandler::getPreservedUsers in src/Event/AcsfDuplicationScrubNodeHandler.php
Gets a list of user IDs which should not be scrubbed.

File

src/Event/AcsfDuplicationScrubEntityHandler.php, line 169

Class

AcsfDuplicationScrubEntityHandler
Handles the scrubbing of Drupal entities.

Namespace

Drupal\acsf\Event

Code

protected function getPreservedUsers() {

  // Preserve site admins.
  $preserved = $this
    ->getSiteAdmins();
  if (array_search(1, $preserved) === FALSE) {

    // Preserve UID 1.
    $preserved[] = 1;
  }

  // Preserve the anonymous user.
  $preserved[] = 0;
  $this->moduleHandler
    ->alter('acsf_duplication_scrub_preserved_users', $preserved);
  return $preserved;
}