123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- <?php
- class ChadoField extends TripalField {
-
- public static $default_label = 'Chado Field';
-
- public static $default_description = 'The generic base class for all Chado fields. ' .
- 'Replace this text as appropriate for the child implementation.';
-
-
-
-
-
- public static $default_settings = array(
- 'storage' => 'field_chado_storage',
- );
-
-
-
-
-
-
-
- public static $default_instance_settings = array(
-
- 'term_vocabulary' => 'schema',
-
- 'term_name' => 'Thing',
-
- 'term_accession' => 'Thing',
-
-
-
- 'term_fixed' => FALSE,
-
- 'chado_table' => '',
-
- 'chado_column' => '',
-
- 'base_table' => '',
- );
-
-
-
- public static $default_view_handlers = array(
- 'field' => array(
- 'handler' => 'tripal_views_handler_field',
- 'click sortable' => TRUE,
- ),
- );
-
- public static $module = 'tripal_chado';
-
- public function query($query, $condition) {
-
-
- $chado_table = $this->instance['settings']['chado_table'];
- $base_table = $this->instance['settings']['base_table'];
- $bschema = chado_get_schema($base_table);
- $bpkey = $bschema['primary key'][0];
- $alias = 'dbx_linker';
- $operator = $condition['operator'];
-
- if ($chado_table == $base_table) {
-
-
- $base_field = tripal_get_chado_semweb_column($chado_table, $condition['column']);
- $query->condition('base.' . $base_field , $condition['value'], $operator);
- }
- else {
-
-
- }
- }
-
- public function queryOrder($query, $order) {
- }
-
- public function instanceSettingsForm() {
-
-
-
- $element['base_table'] = array(
- '#type' => 'value',
- '#value' => $this->instance['settings']['base_table'],
- );
- $element['chado_table'] = array(
- '#type' => 'value',
- '#value' => $this->instance['settings']['chado_table'],
- );
- $element['chado_column'] = array(
- '#type' => 'value',
- '#value' => $this->instance['settings']['chado_column'],
- );
- return $element;
- }
- }
|