xo::db::CrClass instproc new_persistent_object (public)

 <instance of xo::db::CrClass[i]> new_persistent_object \
    [ -package_id package_id ] [ -creation_user creation_user ] \
    [ -creation_ip creation_ip ] args [ args... ]

Defined in packages/xotcl-core/tcl/cr-procs.tcl

Create a new content item of the actual class, configure it with the given arguments and insert it into the database. The XOTcl object is destroyed automatically on cleanup (end of a connection request).

Switches:
-package_id
(optional)
-creation_user
(optional)
-creation_ip
(optional)
Parameters:
args
Returns:
fully qualified object

Partial Call Graph (max 5 caller/called nodes):
%3 test_xotcl_core_tutorial_4 xotcl_core_tutorial_4 (test xotcl-core) xo::db::CrClass instproc new_persistent_object xo::db::CrClass instproc new_persistent_object test_xotcl_core_tutorial_4->xo::db::CrClass instproc new_persistent_object ad_log ad_log (public) xo::db::CrClass instproc new_persistent_object->ad_log ad_try ad_try (public) xo::db::CrClass instproc new_persistent_object->ad_try

Testcases:
xotcl_core_tutorial_4
Source code:
:get_context package_id creation_user creation_ip
# :log "ID [self] create $args"
ad_try {
  :create ::0 {*}$args
} on error {errorMsg} {
  ad_log error "CrClass create raises: $errorMsg"
}
# :log "ID [::0 serialize]"
set item_id [::0 save_new  -package_id $package_id  -creation_user $creation_user  -creation_ip $creation_ip]
::0 move ::$item_id
::$item_id destroy_on_cleanup
return ::$item_id
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: