Class ::xo::db::sql::time_interval (public)
::xo::db::Class ::xo::db::sql::time_interval
Defined in
- Testcases:
-
No testcase defined.
Source code:
namespace eval ::xo::db::sql {}
::nsf::object::alloc ::xo::db::Class ::xo::db::sql::time_interval {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::time_interval
set :security_inherit_p t
set :sql_package_name time_interval
set :supertype acs_object
set :with_table true}
::xo::db::sql::time_interval proc eq {{-dbn {}} -interval_1_id:required -interval_2_id:required} {
foreach var [list INTERVAL_1_ID INTERVAL_2_ID] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select time_interval__eq($_INTERVAL_1_ID, $_INTERVAL_2_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::time_interval proc new {{-dbn {}} -start_date -end_date -childof} {
foreach var [list START_DATE END_DATE] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select time_interval__new($_START_DATE, $_END_DATE)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::time_interval proc shift {{-dbn {}} -interval_id:required {-start_offset 0} {-end_offset 0}} {
foreach var [list INTERVAL_ID START_OFFSET END_OFFSET] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select time_interval__shift($_INTERVAL_ID, $_START_OFFSET, $_END_OFFSET)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::time_interval proc edit {{-dbn {}} -interval_id:required -start_date -end_date} {
foreach var [list INTERVAL_ID START_DATE END_DATE] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select time_interval__edit($_INTERVAL_ID, $_START_DATE, $_END_DATE)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::time_interval proc delete {{-dbn {}} -interval_id:required} {
foreach var [list INTERVAL_ID] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select time_interval__delete($_INTERVAL_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::time_interval proc copy {{-dbn {}} -interval_id:required {-offset 0}} {
foreach var [list INTERVAL_ID OFFSET] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select time_interval__copy($_INTERVAL_ID, $_OFFSET)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::time_interval proc overlaps_p {{-dbn {}} -start_1:required -end_1:required -start_2:required -end_2:required} {
foreach var [list START_1 END_1 START_2 END_2] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select time_interval__overlaps_p($_START_1, $_END_1, $_START_2, $_END_2)
"
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 ]