xo::db::Object instproc update (public)
<instance of xo::db::Object> update [ -package_id package_id ] \ [ -modifying_user modifying_user ] [ -context_id context_id ]
Defined in /var/www/openacs.org/packages/xotcl-core/tcl/05-db-procs.tcl
Update the current object in the database
- Switches:
- -package_id (optional)
- -modifying_user (optional)
- -context_id (optional)
- Testcases:
- xotcl_core_tutorial_2, test_xo_db_object
Source code: set object_id ${:object_id} 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 modifying_user modifying_ip set title ${:object_title} ::xo::dc dml update_object { update acs_objects set title = :title, modifying_user = :modifying_user, modifying_ip = :modifying_ip, context_id = :context_id where object_id = :object_id } # Make sure object memory image reflects db values foreach att {modifying_user modifying_ip context_id} { set :${att} [set $att] } set :last_modified [::xo::dc get_value -prepare integer get_last_modified { select last_modified from acs_objects where object_id = :object_id }]XQL Not present: Generic, PostgreSQL, Oracle