You are here

function openlayers_map_save in Openlayers 7.2

Save a map object to the database.

Parameters

$map: map object.

Return value

The results of DB write or FALSE if no name.

1 call to openlayers_map_save()
openlayers_preset_save in ./openlayers.module

File

./openlayers.module, line 855
Main OpenLayers API File

Code

function openlayers_map_save($map) {
  if (!empty($map->name)) {
    return db_select('openlayers_maps')
      ->fields('openlayers_maps', array(
      'name',
    ))
      ->condition('name', $map->name)
      ->execute()
      ->fetchCol() ? drupal_write_record('openlayers_maps', $map, 'name') : drupal_write_record('openlayers_maps', $map);
  }
  return FALSE;
}