You are here

public function Collection::merge in Openlayers 7.3

Merges another collection into this one.

Parameters

\Drupal\openlayers\Types\Collection $collection: The collection to merge into this one.

File

src/Types/Collection.php, line 184
Class Collection.

Class

Collection
Class Collection.

Namespace

Drupal\openlayers\Types

Code

public function merge(Collection $collection) {
  foreach ($collection
    ->getFlatList() as $object) {
    $this
      ->prepend($object);
  }
}