Microweber\Providers\NotificationsManager::delete_for_module PHP Method

delete_for_module() public method

public delete_for_module ( $module )
    public function delete_for_module($module)
    {
        if ($module != false and $module != '') {
            $table = $this->table;
            $table = $this->app->database_manager->real_table_name($this->table);
            $get_params = array();
            $get_params['table'] = 'notifications';
            $get_params['fields'] = 'id';
            $get_params['module'] = $this->app->database_manager->escape_string($module);
            $data = $this->get($get_params);
            if (is_array($data)) {
                $ids = $this->app->format->array_values($data);
                $idsi = implode(',', $ids);
                $cleanup = "DELETE FROM {$table} WHERE id IN ({$idsi})";
                $this->app->database_manager->q($cleanup);
            }
            $this->app->cache_manager->delete('notifications' . DIRECTORY_SEPARATOR . 'global');
            return true;
        }
    }