xo::db::Class proc class_to_object_type

 xo::db::Class[i] class_to_object_type

Defined in

Partial Call Graph (max 5 caller/called nodes):
%3 test_xotcl-core xotcl-core (test ) xo::db::Class proc class_to_object_type xo::db::Class proc class_to_object_type test_xotcl-core->xo::db::Class proc class_to_object_type test_xotcl_core_tutorial_2 xotcl_core_tutorial_2 (test ) test_xotcl_core_tutorial_2->xo::db::Class proc class_to_object_type

Testcases:
xotcl_core_tutorial_2, xotcl-core
Source code:
if {[:isclass $name]} {
  if {[$name exists object_type]} {
    # The specified class has an object_type defined; return it
    return [$name object_type]
  }
  if {![$name istype ::xo::db::Object]} {
    # The specified class is not subclass of ::xo::db::Object.
    # return acs_object in your desperation.
    return acs_object
  }
}
# Standard mapping rules
switch -glob -- $name {
  ::xo::db::Object   {return acs_object}
  ::xo::db::CrItem   {return content_revision}
  ::xo::db::image    {return image}
  ::xo::db::CrFolder {return content_folder}
  ::xo::db::*        {return [string range $name 10 end]}
  default            {return $name}
}
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: