You are here

function farm_sensor_entity_delete in farmOS 7

Implements hook_entity_delete().

File

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

Code

function farm_sensor_entity_delete($entity, $type) {

  // Only act on farm asset entities.
  if ($type != 'farm_asset') {
    return;
  }

  // Only act on sensor assets.
  if ($entity->type != 'sensor') {
    return;
  }

  // Delete sensor record.
  farm_sensor_delete($entity->id);
}