You are here

public function Base::getId in Openlayers 7.3

Return the object unique ID.

Return value

string The object ID.

Overrides ObjectInterface::getId

1 call to Base::getId()
Map::build in src/Types/Map.php
Build render array of a map.

File

src/Types/Base.php, line 550
Class Object.

Class

Base
Class Base.

Namespace

Drupal\openlayers\Types

Code

public function getId() {
  if (!isset($this->id)) {
    $css_name = drupal_clean_css_identifier($this
      ->getType() . '-' . $this
      ->getMachineName());

    // Use uniqid to ensure we've really an unique id - otherwise there will
    // occur issues with caching.
    $this->id = drupal_html_id('openlayers-' . $css_name . '-' . uniqid('', TRUE));
  }
  return $this->id;
}