Class ::xo::db::sql::ec_product (public)
::xo::db::Class ::xo::db::sql::ec_product
Defined in
- Testcases:
-
No testcase defined.
Source code:
namespace eval ::xo::db::sql {}
::nsf::object::alloc ::xo::db::Class ::xo::db::sql::ec_product {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::ec_product
set :security_inherit_p t
set :sql_package_name ec_product
set :supertype acs_object
set :with_table true}
::xo::db::sql::ec_product proc new {{-dbn {}} -product_id -creation_user -context_id:required -product_name:required -price -sku -one_line_description -detailed_description -search_keywords {-present_p t} {-stock_status o} -dirname {-available_date sysdate} -color_list -size_list -creation_ip -childof} {
foreach var [list PRODUCT_ID CREATION_USER CONTEXT_ID PRODUCT_NAME PRICE SKU ONE_LINE_DESCRIPTION DETAILED_DESCRIPTION SEARCH_KEYWORDS PRESENT_P STOCK_STATUS DIRNAME AVAILABLE_DATE COLOR_LIST SIZE_LIST 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 ec_product__new($_PRODUCT_ID, $_CREATION_USER, $_CONTEXT_ID, $_PRODUCT_NAME, $_PRICE, $_SKU, $_ONE_LINE_DESCRIPTION, $_DETAILED_DESCRIPTION, $_SEARCH_KEYWORDS, $_PRESENT_P, $_STOCK_STATUS, $_DIRNAME, $_AVAILABLE_DATE, $_COLOR_LIST, $_SIZE_LIST, $_CREATION_IP)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::ec_product proc delete {{-dbn {}} -product_id:required} {
foreach var [list PRODUCT_ID] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select ec_product__delete($_PRODUCT_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 ]