acs_object::is_type_p (private)

 acs_object::is_type_p -object_id object_id -object_types object_types \
    [ -no_hierarchy ]

Defined in packages/acs-tcl/tcl/object-procs.tcl

Returns whether an object is of a given object type.

Switches:
-object_id
(required)
-object_types
(required)
-no_hierarchy
(boolean) (optional)
Returns:
boolean

Partial Call Graph (max 5 caller/called nodes):
%3 test_is_object_type_p is_object_type_p (test acs-tcl) acs_object::is_type_p acs_object::is_type_p test_is_object_type_p->acs_object::is_type_p acs_object_type acs_object_type (public) acs_object::is_type_p->acs_object_type acs_object_type::supertypes acs_object_type::supertypes (private) acs_object::is_type_p->acs_object_type::supertypes ad_page_contract_filter_proc_object_type ad_page_contract_filter_proc_object_type (public) ad_page_contract_filter_proc_object_type->acs_object::is_type_p

Testcases:
is_object_type_p
Source code:
    if { ![string is integer -strict $object_id] } {
        return 0
    }

    set object [acs::per_request_cache eval  -key acs-tcl.acs_object.is_type_p($object_id,$object_types,$no_hierarchy_p) {

                        set object_type [acs_object_type $object_id]

                        if {$object_type eq ""} {
                            # Object was not found
                            return 0
                        } elseif {$object_type in $object_types} {
                            # Object is one of the types we look for
                            return 1
                        } elseif {$no_hierarchy_p} {
                            # Object is not one of the types we look
                            # for and we were told to not look into
                            # the hierarchy
                            return 0
                        } else {
                            # We expand the object type hierarchy and
                            # see if one of our supertypes is a type
                            # we look for
                            foreach supertype [acs_object_type::supertypes -subtype $object_type] {
                                if {$supertype in $object_types} {
                                    return 1
                                }
                            }

                            return 0
                        }
                    }]
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/acs-tcl/tcl/object-procs.xql

[ hide source ] | [ make this the default ]
Show another procedure: