category_tree::flush_cache (public)
category_tree::flush_cache tree_id
Defined in packages/categories/tcl/category-trees-procs.tcl
Flushes category tree hierarchy cache of one category tree.
- Parameters:
- tree_id (required)
- category tree to be flushed.
- Author:
- Timo Hentschel <timo@timohentschel.de>
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- category_tree_procs
Source code: set cur_level 1 set stack [list] set invalid_p "" set tree [list] db_foreach flush_cache { select category_id, left_ind, right_ind, case when deprecated_p = 'f' then '' else '1' end as deprecated_p from categories where tree_id = :tree_id order by left_ind } { lappend tree [list $category_id [expr {"$invalid_p$deprecated_p" eq "" ? f : t}] $cur_level] if { $right_ind - $left_ind > 1} { incr cur_level 1 set invalid_p "$invalid_p$deprecated_p" set stack [linsert $stack 0 [list $right_ind $invalid_p]] } else { incr right_ind 1 while {$right_ind == [lindex $stack 0 0] && $cur_level > 0} { incr cur_level -1 incr right_ind 1 set stack [lrange $stack 1 end] } set invalid_p [lindex $stack 0 1] } } if {[info exists category_id]} { nsv_set category_trees $tree_id $tree } else { nsv_set category_trees $tree_id "" }XQL Not present: Generic PostgreSQL XQL file: packages/categories/tcl/category-trees-procs-postgresql.xql
Oracle XQL file: packages/categories/tcl/category-trees-procs-oracle.xql