public function mark_as_read($module)
{
if ($module != false and $module != '') {
$table = $this->table;
$get_params = array();
$get_params['table'] = $table;
$get_params['is_read'] = 0;
$get_params['fields'] = 'id';
if ($module != 'all') {
$get_params['module'] = $this->app->database_manager->escape_string($module);
}
$data = $this->get($get_params);
if (is_array($data)) {
foreach ($data as $value) {
$save['is_read'] = 1;
$save['id'] = $value['id'];
$save['table'] = 'notifications';
$this->app->database_manager->save('notifications', $save);
}
}
$this->app->cache_manager->delete('notifications' . DIRECTORY_SEPARATOR . 'global');
$this->app->cache_manager->delete('notifications');
return $data;
}
}