You are here

function monitoring_sensor_info_load in Monitoring 7

Menu load function to load a sensor info object.

Parameters

string $sensor_name: Sensor name.

Return value

\Drupal\monitoring\Sensor\SensorInfo A SensorInfo instance.

1 call to monitoring_sensor_info_load()
monitoring_views_pre_render in ./monitoring.module
Implements hook_views_pre_render().

File

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

Code

function monitoring_sensor_info_load($sensor_name) {
  try {
    return monitoring_sensor_manager()
      ->getSensorInfoByName($sensor_name);
  } catch (NonExistingSensorException $e) {

    // Return FALSE if a sensor does not exist, this will lead to a page not
    // found response.
    return FALSE;
  }
}