You are here

private function AccessStorage::getArrayItemsToRemove in Permissions by Term 8

Same name and namespace in other branches
  1. 8.2 src/Service/AccessStorage.php \Drupal\permissions_by_term\Service\AccessStorage::getArrayItemsToRemove()

Get array items to remove.

The array items which aren't in the new items array, but are in old items array, will be returned.

Parameters

array $aExistingItems: The existing array items.

array|bool $aNewItems: Either false if there're no new items or an array with items.

Return value

array The array items to remove.

1 call to AccessStorage::getArrayItemsToRemove()
AccessStorage::getPreparedDataForDatabaseQueries in src/Service/AccessStorage.php
Prepares the data which has to be applied to the database.

File

src/Service/AccessStorage.php, line 436

Class

AccessStorage
Class AccessStorage.

Namespace

Drupal\permissions_by_term\Service

Code

private function getArrayItemsToRemove($aExistingItems, $aNewItems) {
  $aRet = [];
  foreach ($aExistingItems as $existingItem) {
    if (!in_array($existingItem, $aNewItems)) {
      $aRet[] = $existingItem;
    }
  }
  return $aRet;
}