function tripal_get_remote_field_doc

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

Retrieves the field information for a content type from a remote Tripal site.

The array returned is equivalent to the Hydra Vocabulary "supportedProperty" stanza that belongs to a Hydra Class (content type).

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.

$field_accession: The controlled vocabulary term accession for the property (i.e. field) of the Class (i.e. content type).

Return value

A PHP array corresponding to the Hydra property stanza (field) that belongs to the given Class (i.e. a content type). Retruns NULL if the property cannot be found.

Related topics

3 calls to tripal_get_remote_field_doc()
tripal_get_remote_field_formatters in tripal_ws/api/tripal_ws.api.inc
Retrieves the list of download formatters for a remote field.
tripal_get_remote_field_info in tripal_ws/api/tripal_ws.api.inc
Behaves similar to the field_info_field() function but for remote fields.
tripal_get_remote_field_instance_info in tripal_ws/api/tripal_ws.api.inc
Behaves similar to the field_info_instance() function but for remote fields.

File

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

Code

function tripal_get_remote_field_doc($site_id, $bundle_accession, $field_accession) {

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

  $class = tripal_get_remote_content_doc($site_id, $bundle_accession);
  $properties = $class['supportedProperty'];
  foreach ($properties as $item) {
    if ($item['property'] == $field_accession) {
      return $item;
    }
  }
  return NULL;
}