function tripal_get_remote_content_doc

3.x tripal_ws.api.inc tripal_get_remote_content_doc($site_id, $bundle_accession)

Retreive the content type information from a remote Tripal site.

The array returned is equivalent to the Hydra Vocabulary "supportedClass" stanza.

Parameters

$site_id: The numeric site ID for the remote Tripal site.

$bundle_accession: The controlled vocabulary term accession for the content type on the remote Tripal site.

Return value

A PHP array corresponding to the Hydra Class stanza (i.e. a content type). Returns NULL if the class ID cannot be found.

Related topics

1 call to tripal_get_remote_content_doc()
tripal_get_remote_field_doc in tripal_ws/api/tripal_ws.api.inc
Retrieves the field information for a content type from a remote Tripal site.

File

tripal_ws/api/tripal_ws.api.inc, line 819
This file provides the Tripal Web Services API: a set of functions for interacting with the Tripal Web Services.

Code

function tripal_get_remote_content_doc($site_id, $bundle_accession) {

  // Get the site documentation (loads from cache if already retrieved).
  $site_doc = tripal_get_remote_API_doc($site_id);

  // Get the class that matches this bundle.
  $classes = $site_doc['supportedClass'];
  $class = NULL;
  foreach ($classes as $item) {
    if ($item['@id'] == $bundle_accession) {
      return $item;
    }
  }
  return NULL;
}