Microweber\Providers\Modules::delete_all PHP Method

delete_all() public method

public delete_all ( )
    public function delete_all()
    {
        if ($this->app->user_manager->is_admin() == false) {
            return false;
        } else {
            $table = $this->tables['modules'];
            $db_categories = $this->table_prefix . 'categories';
            $db_categories_items = $this->table_prefix . 'categories_items';
            $q = "DELETE FROM {$table} ";
            $this->app->database_manager->q($q);
            $q = "DELETE FROM {$db_categories} WHERE rel_type='modules' AND data_type='category' ";
            $this->app->database_manager->q($q);
            $q = "DELETE FROM {$db_categories_items} WHERE rel_type='modules' AND data_type='category_item' ";
            $this->app->database_manager->q($q);
            $this->app->cache_manager->delete('categories' . DIRECTORY_SEPARATOR . '');
            $this->app->cache_manager->delete('categories_items' . DIRECTORY_SEPARATOR . '');
            $this->app->cache_manager->delete('modules' . DIRECTORY_SEPARATOR . '');
        }
    }