You are here

public function Base::getParents in Openlayers 7.3

Returns an array with the maps this object is attached on.

Return value

array An array of map objects this object is attached on. Keyed by the map machine name.

Overrides ObjectInterface::getParents

File

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

Class

Base
Class Base.

Namespace

Drupal\openlayers\Types

Code

public function getParents() {
  return array_filter(Openlayers::loadAll('Map'), function ($map) {
    return array_filter($map
      ->getObjects($this
      ->getType()), function ($object) {
      return $object
        ->getMachineName() == $this
        ->getMachineName();
    });
  });
}