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

 xo::db::CrClass[i] id_belongs_to_package [ -item_id item_id ] \
    [ -revision_id revision_id ] [ -package_id package_id ]

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

Check if the provided item_id or revision_id belongs to the provided package.

Switches:
-item_id
(defaults to "0") (optional)
-revision_id
(defaults to "0") (optional)
-package_id
(optional)
Returns:
boolean success

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.
Source code:
set id [expr {$revision_id ? $revision_id : $item_id}]
if {$id eq 0} {
  return 0
}
set what [expr {$item_id != 0 ? "item_id" : "revision_id"}]
return [::xo::dc 0or1row -prepare integer,integer check_package [subst {
  select 1 from cr_items, acs_objects
  where $what = :$what and object_id = :$what
  and package_id = :package_id
  fetch first 1 rows only
}]]
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: