You are here

public function Collection::prepend in Openlayers 7.3

Add object to this collection.

Parameters

ObjectInterface $object: Object instance to add to this collection.

1 call to Collection::prepend()
Collection::merge in src/Types/Collection.php
Merges another collection into this one.

File

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

Class

Collection
Class Collection.

Namespace

Drupal\openlayers\Types

Code

public function prepend(ObjectInterface $object) {
  $this->objects = array_merge(array(
    $object
      ->getType() . '_' . $object
      ->getMachineName() => $object,
  ), $this->objects);
}