xo::db::CrClass proc get_parent_id (public)

 xo::db::CrClass[i] get_parent_id -item_id item_id 

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

Get the parent_id of a content item either from an already instantiated object or from the database without instantiating it. If item_id is not a valid item_id, we throw an error.

Switches:
-item_id
(required)
Returns:
parent_id

Partial Call Graph (max 5 caller/called nodes):
%3 test_xowiki_test_cases xowiki_test_cases (test xowiki) xo::db::CrClass proc get_parent_id xo::db::CrClass proc get_parent_id test_xowiki_test_cases->xo::db::CrClass proc get_parent_id

Testcases:
xowiki_test_cases
Source code:
# TODO: the following line is deactivated, until we get rid of the "folder object" in xowiki
#if {[nsf::is object ::$item_id]} {return [::$item_id parent_id]}
::xo::dc 1row -prepare integer get_parent "select parent_id from cr_items where item_id = :item_id"
return $parent_id
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: