You are here

function openlayers_style_save in Openlayers 7.2

Same name and namespace in other branches
  1. 6.2 openlayers.module \openlayers_style_save()

Save style.

Parameters

$style: The style object to save.

Return value

The results of DB write or FALSE if no name.

File

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

Code

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