xo::db::CrClass instproc get_instance_from_db (public)
<instance of xo::db::CrClass> get_instance_from_db \ [ -item_id item_id ] [ -revision_id revision_id ] \ [ -initialize on|off ]
Defined in packages/xotcl-core/tcl/cr-procs.tcl
Retrieve either the live revision or a specified revision of a content item with all attributes into a newly created object. The retrieved attributes are stored in the instance variables in class representing the object_type. The XOTcl object is destroyed automatically on cleanup (end of a connection request)
- Switches:
- -item_id
(defaults to"0"
) (optional)- id of the item to be retrieved.
- -revision_id
(defaults to"0"
) (optional)- revision-id of the item to be retrieved.
- -initialize
(boolean) (defaults to"true"
) (optional)- Returns:
- fully qualified object
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- xotcl_core_tutorial_4, test_cr_items, create_folder_with_page, xowiki_test_cases, create_form_with_form_instance
Source code: set object ::[expr {$revision_id ? $revision_id : $item_id}] if {![nsf::is object $object]} { :fetch_object -object $object -item_id $item_id -revision_id $revision_id -initialize $initialize $object destroy_on_cleanup } return $objectXQL Not present: Generic, PostgreSQL, Oracle