12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?php
- class data__sequence extends ChadoField {
-
-
-
-
-
-
-
-
- public static $default_label = 'Sequence';
-
- public static $description = 'A field for managing the primary sequence for a feature.';
-
-
-
-
-
-
-
- public static $default_instance_settings = [
-
- 'term_vocabulary' => 'data',
-
- 'term_name' => 'sequence',
-
- 'term_accession' => '2044',
-
-
-
- 'term_fixed' => FALSE,
- ];
-
-
- public static $download_formatters = [
- 'TripalTabDownloader',
- 'TripalCSVDownloader',
- 'TripalNucFASTADownloader',
- ];
-
- public static $default_widget = 'data__sequence_widget';
-
- public static $default_formatter = 'data__sequence_formatter';
-
- public function elementInfo() {
- $field_term = $this->getFieldTermID();
- return [
- $field_term => [
- 'operations' => [],
- 'sortable' => FALSE,
- 'searchable' => FALSE,
- 'type' => 'xs:string',
- 'readonly' => FALSE,
- ],
- ];
- }
-
- public function load($entity) {
- $field_name = $this->field['field_name'];
- $feature = $entity->chado_record;
- $feature = chado_expand_var($feature, 'field', 'feature.residues');
- $entity->{$field_name}['und'][0]['value'] = $feature->residues;
- }
- }
|