You are here

function farm_sensor_save in farmOS 7

Helper function for saving farm sensor information.

Parameters

int $id: The farm sensor asset id.

string $type: The sensor type.

array $settings: An array of sensor settings.

1 call to farm_sensor_save()
_farm_sensor_entity_save in modules/farm/farm_sensor/farm_sensor.module
Helper function for saving farm sensor information on entity insert and update.

File

modules/farm/farm_sensor/farm_sensor.module, line 332

Code

function farm_sensor_save($id, $type, $settings = array()) {

  // Delete any existing
  farm_sensor_delete($id);

  // Insert a new record.
  $record = array(
    'id' => $id,
    'type' => $type,
    'settings' => $settings,
  );
  drupal_write_record('farm_sensor', $record);
}