本文整理汇总了PHP中Av_sensor::delete_from_db方法的典型用法代码示例。如果您正苦于以下问题:PHP Av_sensor::delete_from_db方法的具体用法?PHP Av_sensor::delete_from_db怎么用?PHP Av_sensor::delete_from_db使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Av_sensor
的用法示例。
在下文中一共展示了Av_sensor::delete_from_db方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unset
$data['data'] = _('Error! Sensor ID not allowed. Sensor could not be removed');
} else {
try {
$db = new ossim_db();
$conn = $db->connect();
$sensor_policies = 0;
if ($check_policies == 1) {
$sensor_policies = Policy_sensor_reference::get_policy_by_sensor($conn, $id);
if (count($sensor_policies) > 0) {
$data['status'] = 'warning';
$data['data'] = _('This sensor belongs to a policy');
}
}
if ($check_policies == 0 || count($sensor_policies) == 0) {
$sensor = new Av_sensor($id);
$sensor->delete_from_db($conn);
$data['status'] = 'success';
$data['data'] = _('Sensor removed successfully');
//Remove sensor list from Session
unset($_SESSION['_sensor_list']);
}
$db->close();
} catch (Exception $e) {
$data['status'] = 'error';
$data['data'] = _($e->getMessage());
}
}
break;
case 'stats':
require_once 'get_sensors.php';
try {