namespace eval ::xo::db::sql {}
::nsf::object::alloc ::xo::db::Class ::xo::db::sql::category_tree {set :__default_metaclass ::xotcl::Class
set :__default_superclass ::xotcl::Object
set :abstract_p f
set :auto_save false
set :name_method {}
set :object_type ::xo::db::sql::category_tree
set :security_inherit_p t
set :sql_package_name category_tree
set :supertype acs_object
set :with_table true}
::xo::db::sql::category_tree proc new_translation {{-dbn {}} -tree_id:required -locale:required -tree_name:required -description:required -modifying_date:required -modifying_user:required -modifying_ip:required} {
foreach var [list TREE_ID LOCALE TREE_NAME DESCRIPTION MODIFYING_DATE MODIFYING_USER MODIFYING_IP] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select category_tree__new_translation($_TREE_ID, $_LOCALE, $_TREE_NAME, $_DESCRIPTION, $_MODIFYING_DATE, $_MODIFYING_USER, $_MODIFYING_IP)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::category_tree proc name {{-dbn {}} -tree_id:required} {
foreach var [list TREE_ID] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select category_tree__name($_TREE_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::category_tree proc del {{-dbn {}} -tree_id:required} {
foreach var [list TREE_ID] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select category_tree__del($_TREE_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::category_tree proc unmap {{-dbn {}} -object_id:required -tree_id:required} {
foreach var [list OBJECT_ID TREE_ID] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select category_tree__unmap($_OBJECT_ID, $_TREE_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::category_tree proc new {{-dbn {}} -tree_id:required -locale:required -tree_name:required -description:required -site_wide_p:required -creation_date:required -creation_user:required -creation_ip:required -context_id:required -childof} {
foreach var [list TREE_ID LOCALE TREE_NAME DESCRIPTION SITE_WIDE_P CREATION_DATE CREATION_USER CREATION_IP CONTEXT_ID] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select category_tree__new($_TREE_ID, $_LOCALE, $_TREE_NAME, $_DESCRIPTION, $_SITE_WIDE_P, $_CREATION_DATE, $_CREATION_USER, $_CREATION_IP, $_CONTEXT_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::category_tree proc map {{-dbn {}} -object_id:required -tree_id:required -subtree_category_id:required -assign_single_p:required -require_category_p:required -widget:required} {
foreach var [list OBJECT_ID TREE_ID SUBTREE_CATEGORY_ID ASSIGN_SINGLE_P REQUIRE_CATEGORY_P WIDGET] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select category_tree__map($_OBJECT_ID, $_TREE_ID, $_SUBTREE_CATEGORY_ID, $_ASSIGN_SINGLE_P, $_REQUIRE_CATEGORY_P, $_WIDGET)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::category_tree proc edit {{-dbn {}} -tree_id:required -locale:required -tree_name:required -description:required -site_wide_p:required -modifying_date:required -modifying_user:required -modifying_ip:required} {
foreach var [list TREE_ID LOCALE TREE_NAME DESCRIPTION SITE_WIDE_P MODIFYING_DATE MODIFYING_USER MODIFYING_IP] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select category_tree__edit($_TREE_ID, $_LOCALE, $_TREE_NAME, $_DESCRIPTION, $_SITE_WIDE_P, $_MODIFYING_DATE, $_MODIFYING_USER, $_MODIFYING_IP)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::category_tree proc check_nested_ind {{-dbn {}} -tree_id:required} {
foreach var [list TREE_ID] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select category_tree__check_nested_ind($_TREE_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::category_tree proc copy {{-dbn {}} -source_tree:required -dest_tree:required -creation_user:required -creation_ip:required} {
foreach var [list SOURCE_TREE DEST_TREE CREATION_USER CREATION_IP] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select category_tree__copy($_SOURCE_TREE, $_DEST_TREE, $_CREATION_USER, $_CREATION_IP)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}