You are here

public function Collection::remove in Openlayers 7.3

Remove an object from the collection.

Parameters

string $id: The machine name (same as ID) of the object.

File

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

Class

Collection
Class Collection.

Namespace

Drupal\openlayers\Types

Code

public function remove($id) {
  foreach ($this->objects as $collection_id => $object) {
    if ($id === $object
      ->getMachineName()) {
      unset($this->objects[$collection_id]);
    }
  }
}