You are here

private function AccessStorage::getArrayItemsToAdd 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::getArrayItemsToAdd()

Get the array items to add.

The items in the new items array, which aren't in the existing items array, will be returned.

Parameters

array $aNewItems: The new array items.

array $aExistingItems: The existing array items.

Return value

array The items which needs to be added.

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

File

src/Service/AccessStorage.php, line 462

Class

AccessStorage
Class AccessStorage.

Namespace

Drupal\permissions_by_term\Service

Code

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