application_data_link::get_links_to (public)

 application_data_link::get_links_to -object_id object_id \
    [ -from_type from_type ] [ -relation_tag relation_tag ]

Defined in packages/acs-tcl/tcl/application-data-link-procs.tcl

Get a list of objects that are linked to an object, possible using the relation_tag. If from_type is a subtype of content_revision, we lookup content_items that have that content_type

Switches:
-object_id (required)
object_id two, get objects linked to this object
-from_type (optional)
object_type of the objects to get links from
-relation_tag (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 content::type::is_content_type content::type::is_content_type (public) db_list db_list (public) db_map db_map (public) application_data_link::get_links_to application_data_link::get_links_to application_data_link::get_links_to->content::type::is_content_type application_data_link::get_links_to->db_list application_data_link::get_links_to->db_map

Testcases:
No testcase defined.
Source code:
    set from_type_where_clause ""
    set content_type_from_clause ""

    if {[info exists from_type] && $from_type ne ""} {
        set from_type_clause [db_map from_type_where_clause]
        if {[content::type::is_content_type -content_type $from_type]} {
            set from_type_clause [db_map content_type_where_clause]
            set content_type_from_clause [db_map content_type_from_clause]
        }
    }
    return [db_list links_to {}]
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
<fullquery name="application_data_link::get_links_to.links_to">
    <querytext>
        select object_id_one
        from acs_data_links,
        acs_objects
	$content_type_from_clause
        where object_id_two = :object_id
	and object_id = object_id_one
    [application_data_link::relation_tag_where_clause -relation_tag $relation_tag]
	$from_type_where_clause
    </querytext>
</fullquery>

<fullquery name="application_data_link::get_links_to.from_type_clause">
    <querytext>
	and object_type = :from_type
    </querytext>
</fullquery>

<fullquery name="application_data_link::get_links_to.content_type_from_clause">
    <querytext>
	, cr_items
    </querytext>
</fullquery>

<fullquery name="application_data_link::get_links_to.content_type_where_clause">
    <querytext>
	and content_type = :object_type
    </querytext>
</fullquery>
packages/acs-tcl/tcl/application-data-link-procs.xql

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