public function local__source_data::load

3.x local__source_data.inc public local__source_data::load($entity)

Overrides TripalField::load

See also

TripalField::load()

File

tripal_chado/includes/TripalFields/local__source_data/local__source_data.inc, line 147

Class

local__source_data

Code

public function load($entity) {
  $analysis = $entity->chado_record;
  $field_name = $this->field['field_name'];
  $field_type = $this->field['type'];
  $field_table = $this->instance['settings']['chado_table'];
  $field_column = $this->instance['settings']['chado_column'];

  $sourcename_term = chado_get_semweb_term('analysis', 'sourcename');
  $sourceversion_term = chado_get_semweb_term('analysis', 'sourceversion');
  $sourceuri_term = chado_get_semweb_term('analysis', 'sourceuri');

  $entity->{$field_name}['und'][0] = array(
    'value' => array(
      $sourcename_term => $analysis->sourcename,
      $sourceversion_term => $analysis->sourceversion,
      $sourceuri_term => $analysis->sourceuri,
    ),
    'chado-analysis__sourcename' => $analysis->sourcename,
    'chado-analysis__sourceversion' => $analysis->sourceversion,
    'chado-analysis__sourceuri' => $analysis->sourceuri,
  );
}