Class ::xo::db::sql::url (public)
::xo::db::Class ::xo::db::sql::url
Defined in
- Testcases:
-
No testcase defined.
Source code:
namespace eval ::xo::db::sql {}
::nsf::object::alloc ::xo::db::Class ::xo::db::sql::url {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::url
set :security_inherit_p t
set :sql_package_name url
set :supertype acs_object
set :with_table true}
::xo::db::sql::url proc new {{-dbn {}} -url_id:required -url_title:required -host_url -complete_url:required -meta_keywords -meta_description -creation_user -creation_ip -context_id -childof} {
foreach var [list URL_ID URL_TITLE HOST_URL COMPLETE_URL META_KEYWORDS META_DESCRIPTION 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 url__new($_URL_ID, $_URL_TITLE, $_HOST_URL, $_COMPLETE_URL, $_META_KEYWORDS, $_META_DESCRIPTION, $_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::url proc insert_or_update {{-dbn {}} -url_title:required -host_url:required -complete_url:required -meta_keywords:required -meta_description:required -creation_user:required -creation_ip:required -context_id:required} {
foreach var [list URL_TITLE HOST_URL COMPLETE_URL META_KEYWORDS META_DESCRIPTION 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 url__insert_or_update($_URL_TITLE, $_HOST_URL, $_COMPLETE_URL, $_META_KEYWORDS, $_META_DESCRIPTION, $_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::url proc delete {{-dbn {}} -url_id:required} {
foreach var [list URL_ID] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select url__delete($_URL_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
XQL Not present:Generic, PostgreSQL, Oracle
[
hide source ]
| [
make this the default ]