ChadoField.inc 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. class ChadoField extends TripalField {
  3. // The default lable for this field.
  4. public static $default_label = 'Chado Field';
  5. // The default description for this field.
  6. public static $default_description = 'The generic base class for all Chado fields. ' .
  7. 'Replace this text as appropriate for the child implementation.';
  8. // A list of global settings. These can be accessed witihn the
  9. // globalSettingsForm. When the globalSettingsForm is submitted then
  10. // Drupal will automatically change these settings for all fields.
  11. // Once instances exist for a field type then these settings cannot be
  12. // changed.
  13. public static $default_settings = array(
  14. 'storage' => 'field_chado_storage',
  15. );
  16. // Provide a list of instance specific settings. These can be access within
  17. // the instanceSettingsForm. When the instanceSettingsForm is submitted
  18. // then Drupal with automatically change these settings for the instnace.
  19. // It is recommended to put settings at the instance level whenever possible.
  20. // If you override this variable in a child class be sure to replicate the
  21. // term_name, term_vocab, term_accession and term_fixed keys as these are
  22. // required for all TripalFields.
  23. public static $default_instance_settings = array(
  24. // The short name for the vocabulary (e.g. shcema, SO, GO, PATO, etc.).
  25. 'term_vocabulary' => 'schema',
  26. // The name of the term.
  27. 'term_name' => 'Thing',
  28. // The unique ID (i.e. accession) of the term.
  29. 'term_accession' => 'Thing',
  30. // Set to TRUE if the site admin is allowed to change the term
  31. // type. This will create form elements when editing the field instance
  32. // to allow the site admin to change the term settings above.
  33. 'term_fixed' => FALSE,
  34. // The table in Chado that the instance maps to.
  35. 'chado_table' => '',
  36. // The primary key column of hte table in Dhado.
  37. 'chado_column' => '',
  38. // The base table.
  39. 'base_table' => '',
  40. );
  41. // The module that manages this field.
  42. public static $module = 'tripal_chado';
  43. /**
  44. * A query function used to find records that match a given condition.
  45. *
  46. * Entities can be filtered using the fields. This function should be
  47. * implemented if the field supports filtering. To provide filtering,
  48. * the $query object should be updated to including any joins and
  49. * conditions necessary. When giving alias to joined tables be sure to
  50. * use aliases that are unique to avoid conflicts with other fields. When
  51. * joining with the base table its alias is 'base'. This function should
  52. * never set the fields that should be returned nor ordering or group by.
  53. *
  54. * @param $condition
  55. * The field specific condition as set in the TripalFieldQuery object.
  56. * @param $query
  57. * A SelectQuery object.
  58. */
  59. public function query($condition, &$query) {
  60. }
  61. }