protected StorageComparer::addChangeList($collection, $op, array $changes, array $sort_order = NULL)
Adds changes to the changelist.
Parameters
string $collection: The storage collection to add changes for.
string $op: The change operation performed. Either delete, create, rename, or update.
array $changes: Array of changes to add to the changelist.
array $sort_order: Array to sort that can be used to sort the changelist. This array must contain all the items that are in the change list.
File
- core/lib/Drupal/Core/Config/StorageComparer.php, line 183
Class
- StorageComparer
- Defines a config storage comparer.
Namespace
Drupal\Core\Config
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | protected function addChangeList( $collection , $op , array $changes , array $sort_order = NULL) { // Only add changes that aren't already listed. $changes = array_diff ( $changes , $this ->changelist[ $collection ][ $op ]); $this ->changelist[ $collection ][ $op ] = array_merge ( $this ->changelist[ $collection ][ $op ], $changes ); if (isset( $sort_order )) { $count = count ( $this ->changelist[ $collection ][ $op ]); // Sort the changelist in the same order as the $sort_order array and // ensure the array is keyed from 0. $this ->changelist[ $collection ][ $op ] = array_values ( array_intersect ( $sort_order , $this ->changelist[ $collection ][ $op ])); if ( $count != count ( $this ->changelist[ $collection ][ $op ])) { throw new \InvalidArgumentException( "Sorting the $op changelist should not change its length." ); } } } |
Please login to continue.