12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- class uo__unit extends ChadoField {
-
- public static $default_label = 'Unit';
-
- public static $description = 'The unit of measurement.';
-
-
-
-
-
-
-
- public static $default_instance_settings = array(
-
- 'term_vocabulary' => 'UO',
-
- 'term_name' => 'unit',
-
- 'term_accession' => '0000000',
-
-
-
- 'term_fixed' => FALSE,
- );
-
- public static $default_widget = 'UO__unit_widget';
-
- public static $default_formatter = 'UO__unit_formatter';
-
- public function load($entity, $details = array()) {
- $record = $details['record'];
- $settings = $this->instance['settings'];
- $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'];
-
- $entity->{$field_name}['und'][0] = array(
- 'value' => '',
- );
- if ($record) {
- $entity->{$field_name}['und'][0]['value'] = $record->unittype_id->name;
- }
- }
- }
|