xo::db::Object instproc save_new (public)

 <instance of xo::db::Object[i]> save_new [ -package_id package_id ] \
    [ -creation_user creation_user ] [ -creation_ip creation_ip ] \
    [ -context_id context_id ]

Defined in /var/www/openacs.org/packages/xotcl-core/tcl/05-db-procs.tcl

Save the XOTcl Object with a fresh acs_object in the database.

Switches:
-package_id (optional)
-creation_user (optional)
-creation_ip (optional)
-context_id (optional)
Returns:
new object id

Testcases:
test_xo_db_object
Source code:
if {![info exists package_id] && [info exists :package_id]} {
  set package_id ${:package_id}
}
if {![info exists context_id]} {
  set context_id [expr {[info exists :context_id] ? ${:context_id} : ""}]
}
[:info class] get_context package_id creation_user creation_ip
::xo::dc transaction {
  set id [[:info class] new_acs_object  -package_id $package_id  -creation_user $creation_user  -creation_ip $creation_ip  -context_id $context_id  ""]
  [:info class] initialize_acs_object [self$id
  :insert
}
return $id
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: