class WebServicesField

@class Purpose:

Data: Assumptions:

Hierarchy

Expanded class hierarchy of WebServicesField

File

tripal_ws/includes/TripalFields/WebServicesField.inc, line 9

View source
class WebServicesField extends TripalField {

  // --------------------------------------------------------------------------
  //                     EDITABLE STATIC CONSTANTS
  //
  // The following constants SHOULD be set for each descendant class.  They are
  // used by the static functions to provide information to Drupal about
  // the field and it's default widget and formatter.
  // --------------------------------------------------------------------------

  // The default label for this field.
  public static $default_label = 'Remote Data';

  // The default description for this field.
  public static $default_description = '';
  /*
  // The default widget for this field.
  public static $default_widget = '';

  // The default formatter for this field.
  public static $default_formatter = '';
*/
  // The module that manages this field.
  public static $module = 'tripal_ws';

  // A list of global settings. These can be accessed within the
  // globalSettingsForm.  When the globalSettingsForm is submitted then
  // Drupal will automatically change these settings for all fields.
  // Once instances exist for a field type then these settings cannot be
  // changed.
  public static $default_settings = array(
    'storage' => 'field_tripal_ws_storage',
    // It is expected that all fields set a 'value' in the load() function.
    // In many cases, the value may be an associative array of key/value pairs.
    // In order for Tripal to provide context for all data, the keys should
    // be a controlled vocabulary term (e.g. rdfs:type). Keys in the load()
    // function that are supported by the query() function should be
    // listed here.
    'searchable_keys' => array(),
  );

  // Provide a list of instance specific settings. These can be access within
  // the instanceSettingsForm.  When the instanceSettingsForm is submitted
  // then Drupal with automatically change these settings for the instance.
  // It is recommended to put settings at the instance level whenever possible.
  // If you override this variable in a child class be sure to replicate the
  // term_name, term_vocab, term_accession and term_fixed keys as these are
  // required for all TripalFields.
  public static $default_instance_settings = array(
    // The short name for the vocabulary (e.g. schema, SO, GO, PATO, etc.).
    'term_vocabulary' => 'schema',
    // The name of the term.
    'term_name' => 'Thing',
    // The unique ID (i.e. accession) of the term.
    'term_accession' => 'Thing',
    // Set to TRUE if the site admin is not allowed to change the term
    // type, otherwise the admin can change the term mapped to a field.
    'term_fixed' => FALSE,
    // Indicates if this field should be automatically attached to display
    // or web services or if this field should be loaded separately. This
    // is convenient for speed.  Fields that are slow should for loading
    // should have auto_attach set to FALSE so tha their values can be
    // attached asynchronously.
    'auto_attach' => FALSE,
  );

  // A boolean specifying that users should not be allowed to create
  // fields and instances of this field type through the UI. Such
  // fields can only be created programmatically with field_create_field()
  // and field_create_instance().
  // public static $no_ui = FALSE;

  // A boolean specifying that the field will not contain any data. This
  // should exclude the field from web services or downloads.  An example
  // could be a quick search field that appears on the page that redirects
  // the user but otherwise provides no data.
  //public static $no_data = FALSE;


  /**
   * Loads the field values from the underlying data store.
   *
   * @param $entity
   *
   * @return
   *   An array of the following format:
   *     $entity->{$field_name}['und'][0]['value'] = $value;
   *   where:
   *     - $entity is the entity object to which this field is attached.
   *     - $field_name is the name of this field
   *     - 'und' is the language code (in this case 'und' == undefined)
   *     - 0 is the cardinality.  Increment by 1 when more than one item is
   *       available.
   *     - 'value' is the key indicating the value of this field. It should
   *       always be set.  The value of the 'value' key will be the contents
   *       used for web services and for downloadable content.  The value
   *       should be of the follow format types: 1) A single value (text,
   *       numeric, etc.) 2) An array of key value pair. 3) If multiple entries
   *       then cardinality should incremented and format types 1 and 2 should
   *       be used for each item.
   *   The array may contain as many other keys at the same level as 'value'
   *   but those keys are for internal field use and are not considered the
   *   value of the field.
   *
   *
   */
  public function load($entity) {
  }

}

Members

Contains filters are case sensitive
Namesort descending Modifiers Type Description
TripalField::$default_formatter public static property
TripalField::$default_widget public static property
TripalField::$download_formatters public static property
TripalField::$field protected property
TripalField::$instance protected property
TripalField::$no_data public static property
TripalField::$no_ui public static property
TripalField::$term protected property
TripalField::createInstance public function After a field instance is created the following function is run.
TripalField::elementInfo public function Provides the list of elements returned by the 'value' of the field.
TripalField::getField public function
TripalField::getFieldName public function Retrives the name of this field.
TripalField::getFieldTerm public function
TripalField::getFieldTermID public function
TripalField::getInstance public function
TripalField::getPagerElementID protected function When constructing a pager for use by a field, all pagers must have a unique ID
TripalField::info public static function Provides default information about this field type
TripalField::instanceSettingsForm public function Provides a form for the 'Field Settings' of an instance of this field.
TripalField::instanceSettingsFormValidate public function Provides validation of the instance settings form.
TripalField::query public function Used to filter records that match a given condition.
TripalField::queryOrder public function Used to sort records that have been filtered.
TripalField::settingsForm public function Provides a form for the 'Field Settings' of the field management page.
TripalField::settingsFormValidate public function _state
TripalField::validate public function Perform validation of the field regardless how it is updated.
TripalField::viewsData public function Describes this field to Views.
TripalField::webServicesData public function Describes this field to Tripal web services.
TripalField::_addViewsDataElement protected function
TripalField::_addWebServiceElement protected function
TripalField::__construct public function Instantiates a new TripalField object.
WebServicesField::$default_description public static property Overrides TripalField::$default_description
WebServicesField::$default_instance_settings public static property Overrides TripalField::$default_instance_settings
WebServicesField::$default_label public static property Overrides TripalField::$default_label
WebServicesField::$default_settings public static property Overrides TripalField::$default_settings
WebServicesField::$module public static property Overrides TripalField::$module
WebServicesField::load public function Loads the field values from the underlying data store. Overrides TripalField::load