function tripal_get_remote_field_info
3.x tripal_ws.api.inc | tripal_get_remote_field_info($site_id, $bundle_accession, $field_accession) |
Behaves similar to the field_info_field() function but for remote fields.
Returns a "fake" field info array for fields attached to content types on remote Tripal sites.
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
An array similar to that returned by the field_info_field function of Drupal for local fields.
Related topics
3 calls to tripal_get_remote_field_info()
- TripalFieldDownloader::setRemoteFields in tripal/
includes/ TripalFieldDownloaders/ TripalFieldDownloader.inc - A helper function for the setFields() function.
- tripal_load_remote_entities in tripal_ws/
api/ tripal_ws.api.inc - Queries a remote site for an array of bulk entity ids.
- tripal_load_remote_entity in tripal_ws/
api/ tripal_ws.api.inc - Queries a remote site for an entity.
File
- tripal_ws/
api/ tripal_ws.api.inc, line 732 - 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_info($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);
// Get the property from the document for this field.
$property = tripal_get_remote_field_doc($site_id, $bundle_accession, $field_accession);
// Now create the fake field and instance.
list($vocab, $accession) = explode(':', $field_accession);
$field_name = 'tripal_remote_site_' . $site_id . '_' . $field_accession;
$field = array(
'field_name' => $field_name,
'type' => $field_name,
'storage' => array(
'type' => 'tripal_remote_site'
),
);
return $field;
}