You are here

function monitoring_node_type_delete in Monitoring 8

File

./monitoring.module, line 454
Monitoring bootstrap file.

Code

function monitoring_node_type_delete(NodeTypeInterface $type) {

  // Don't do anything if we are syncing or if the sensor does not exists.
  $config_id = 'node_new_' . $type
    ->id();
  if ($type
    ->isSyncing() || !SensorConfig::load($config_id)) {
    return;
  }
  $sensor = SensorConfig::load($config_id);
  $sensor
    ->delete();
}