|
Tripal
|


Public Member Functions | |
| storageSettingsFormBaseTableAjaxCallback ($form, &$form_state) | |
| storageSettingsFormLinkingMethodAjaxCallback ($form, &$form_state) | |
| isCompatible (TripalEntityType $entity_type) | |
Public Member Functions inherited from Drupal\tripal\TripalField\TripalFieldItemBase | |
| fieldSettingsForm (array $form, FormStateInterface $form_state) | |
| storageSettingsForm (array &$form, FormStateInterface $form_state, $has_data) | |
| tripalStorageId () | |
| tripalSave ($field_item, $field_name, $prop_types, $prop_values, $entity) | |
| tripalLoad ($field_item, $field_name, $prop_types, $prop_values, $entity) | |
| tripalClear ($field_item, $field_name, $prop_types, $prop_values, $entity) | |
| sanitizeKey ($key) | |
| tripalValuesTemplate ($field_definition, $default_value=NULL) | |
| getFieldMaxDelta () | |
Static Public Member Functions | |
| static | defaultStorageSettings () |
| static | storageSettingsFormValidateBaseTable (array $form, FormStateInterface $form_state) |
| static | storageSettingsFormValidateLinkingMethod (array $form, FormStateInterface $form_state) |
| static | get_linker_table_and_column ($storage_settings, $default_table, $default_column) |
| static | discoverPostprocess (array $field_list) |
| static | getChadoTableDefs (array $table_names, ?ChadoSchema $schema=NULL) |
| static | getChadoTableDef (string $table_name, ?ChadoSchema $schema=NULL) |
| static | getChadoForeignKeyDef (string $left_table, ?string $right_table=NULL, ?ChadoSchema $schema=NULL) |
Static Public Member Functions inherited from Drupal\tripal\TripalField\TripalFieldItemBase | |
| static | defaultFieldSettings () |
| static | buildVocabularyTermTable (array &$elements, TripalTerm $term, TripalIdSpaceBase $idSpace, TripalVocabularyBase $vocabulary,) |
| static | buildFieldTermForm ($field, $form, FormStateInterface $form_state) |
| static | fieldSettingsFormValidate (array $form, FormStateInterface $form_state) |
| static | propertyDefinitions (FieldStorageDefinitionInterface $field_definition) |
| static | schema (FieldStorageDefinitionInterface $field_definition) |
| static | getFormStateSettings (FormStateInterface $form_state) |
| static | discover (TripalEntityType $bundle, string $field_id, array $field_types, array $field_instances) |
| static | generateFieldName (TripalEntityType $bundle, string $extra, int $cvterm_id=0) |
Static Public Member Functions inherited from Drupal\tripal\TripalField\Interfaces\TripalFieldItemInterface | |
| static | tripalTypes ($field_definition) |
Protected Member Functions | |
| getBaseTables ($linked_table, $has_linker_table=FALSE) | |
| getTableColumnSelectOptions ($table_name='', $column_types=[]) | |
| getTableColumns ($table_name, $column_types=[]) | |
| getLinkerTableSelectOptions ($object_table, $base_table, $delimiter=" \u{2192} ") | |
| getLinkerTables ($object_table, $base_table) | |
| removeIncompatibleField (string $bundle, string $machine_name) | |
Static Protected Member Functions | |
| static | parse_combined_table_and_column ($table_and_column) |
| static | createFieldEntry (TripalEntityType $bundle, array $options) |
| static | discoverBase (TripalEntityType $bundle, string $field_id, array $field_types, array $field_instances, array $options) |
| static | discoverDirect (TripalEntityType $bundle, string $field_id, array $field_types, array $field_instances, array $options) |
| static | discoverLinked (TripalEntityType $bundle, string $field_id, array $field_types, array $field_instances, array $options) |
| static | getPossibleLinkingTables (array $options) |
| static | getPrimaryKeys (array $table_names, ?ChadoSchema $schema=NULL) |
| static | getPrimaryKey (string $table_name, ?ChadoSchema $schema=NULL) |
Static Protected Attributes | |
| static | $record_id_term = 'SIO:000729' |
| static | $select_base_column = FALSE |
| static | $valid_base_column_types = [] |
| static | $object_table = NULL |
| static | $table_column_delimiter = " \u{2192} " |
| static | $drupal_entity_term = 'schema:ItemPage' |
| static | $chadostorage_namespace = 'Drupal\tripal_chado\Plugin\TripalStorage\ChadoStorage' |
| static | $drupal_entity_callback = 'drupalEntityIdLookupCallback' |
| static | $mapping = NULL |
Defines the Tripal field item base class.
|
staticprotected |
Creates an array defining a single discovered field.
| TripalEntityType | $bundle | The bundle that the field will be added to |
| array | $options | All of the specific values for this field |
|
static |
{{}}
Reimplemented from Drupal\tripal\TripalField\TripalFieldItemBase.
Reimplemented in Drupal\tripal_chado\Plugin\Field\FieldType\ChadoAdditionalTypeTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoAnalysisTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoArrayDesignTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoAssayTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoBiomaterialTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoBooleanTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoContactByRoleTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoContactTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoDbxrefTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoFeatureMapTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoFeatureTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoIntegerTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoOrganismTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoProjectTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoPropertyTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoProtocolTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoRelationshipTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoSequenceChecksumTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoSequenceCoordinatesDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoSequenceLengthTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoSequenceTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoSourceDataTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoStockTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoStringTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoStudyTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoSynonymTypeDefault, and Drupal\tripal_chado\Plugin\Field\FieldType\ChadoTextTypeDefault.
|
staticprotected |
Discover fields that use a column in the base table.
This is used by ChadoFieldItemBase::discover().
| \Drupal\tripal\Entity\TripalEntityType | $bundle | The entity type object for which new field instances should be found. |
| string | $field_id | The id of the field. |
| array | $field_types | An array where each item defines a field type that is attached to this bundle. Each item is itself an array of the annotation defined at the top of that particular field type class. |
| array | $field_instances | An array of FieldConfig objects where each object defines a field attached to this content type. |
| array | $options | Specific options from the field's discover() function. Required keys:
|
|
staticprotected |
Discover fields that use a foreign key in the specified base table.
This is used by ChadoFieldItemBase::discover().
| \Drupal\tripal\Entity\TripalEntityType | $bundle | The entity type object for which new field instances should be found. |
| string | $field_id | The id of the field. |
| array | $field_types | An array where each item defines a field type that is attached to this bundle. Each item is itself an array of the annotation defined at the top of that particular field type class. |
| array | $field_instances | An array of FieldConfig objects where each object defines a field attached to this content type. |
| array | $options | Specific options from the field's discover() function. Required keys:
|
|
staticprotected |
Discover fields that link to the base table through a linking table.
This is used by ChadoFieldItemBase::discover().
| \Drupal\tripal\Entity\TripalEntityType | $bundle | The entity type object for which new field instances should be found. |
| string | $field_id | The id of the field. |
| array | $field_types | An array where each item defines a field type that is attached to this bundle. Each item is itself an array of the annotation defined at the top of that particular field type class. |
| array | $field_instances | An array of FieldConfig objects where each object defines a field attached to this content type. |
| array | $options | Specific options from the field's discover() function. Required keys:
|
|
static |
Adds tripal term plugin IDs for the field's term.
Used for the field discovery process if a DB or CV is not a tripal collection yet.
| array | $field_list | Discoverd field definitions. |
|
static |
Retrieve linker table and column from storage settings, used in a field's tripalTypes() function.
| array | $storage_settings | Storage settings for a field |
| string | $default_table | This will be the base table for the field |
| string | $default_column | This will be the object pkey column for the field |
|
protected |
Return a list of candidate base tables. We only want to present valid tables to the user, which are those with an appropriate foreign key.
| string | $linked_table | The Chado table being linked to via a foreign key. |
| bool | $has_linker_table | When set to false (default), base tables are only those tables with a foreign key to $linked_table. When set to true, also include tables based on two foreign keys in linker tables, one to the specified $linked_table, and a second to a different table. |
|
static |
Get a foreign key definition for a chado table.
| string | $left_table | The name of the table the foreign key resides in. E.g. 'feature' for the feature.type_id => cvterm.cvterm_id foreign key. |
| string | null | $right_table | The name of the table the foreign key refers to. For the example above it would be cvterm. If NULL, then all foreign keys are returned. |
| \tripal_chado\Database\ChadoSchema | ?Drupal,$schema | The chado schema definition. |
|
static |
Get a single table definitions from the chado schema.
| string | $table_name | The table name to query. |
| Drupal\tripal_chado\Database\ChadoSchema | null | $schema | The chado schema definition. |
|
static |
Get multiple table definitions from the chado schema.
| array | $table_names | The table names to query. |
| Drupal\tripal_chado\Database\ChadoSchema | null | $schema | The chado schema definition. |
|
protected |
Return a list of candidate linking connections given a base table and a linked table. These can either be a column in the base table, or a connection through a linking table that connects the base table to the linked table.
| string | $base_table | The Chado table being used for the current entity (subject). |
| string | $object_table | The Chado table being linked to (object). |
|
protected |
Return a list of candidate linking connections given a base table and a linked table. These can either be a column in the base table, or a connection through a linking table that connects the base table to the linked table. In some cases there may be more than one way to link the two tables, so the list generated here can be presented to the site administrator to select the desired linking method.
| string | $base_table | The Chado table being used for the current entity (subject). |
| string | $object_table | The Chado table being linked to (object). |
| string | $delimiter | The displayed delimiter between the table and column in the form select. This defaults to a right arrow. |
|
staticprotected |
Constructs a list of possible linking tables
| array | $options | The options passed to discoverLinked(). Keys used here:
|
|
staticprotected |
Retrieves the name of the primary key for a Chado table.
To also support custom chado tables, the definition is loaded from the database if necessary. Note that this may return a different definition array, specifically the value may be an array instead of a string.
| string | $table_name | The chado table to look up the primary key for. |
| Drupal\tripal_chado\Database\ChadoSchema | null | $schema | The chado schema definition. |
|
staticprotected |
Retrieves the name of the primary key for Chado tables.
To also support custom chado tables, the definition is loaded from the database if necessary. Note that this may return a different definition array, specifically the value may be an array instead of a string.
| string | $table_names | The chado tables to look up the primary key for. |
| Drupal\tripal_chado\Database\ChadoSchema | null | $schema | The chado schema definition. |
|
protected |
Return a list of column names for the indicated table.
| string | $table_name | The Chado table of interest. |
| array | $column_types | If specified, limit to specified column types, e.g. "character varying", "text", "bigint", etc. |
|
protected |
Return a list of column names for the indicated table.
| string | $table_name | The Chado table of interest. |
| array | $column_types | If specified, limit to specified column types, e.g. "character varying", "text", "bigint", etc. |
| Drupal\tripal_chado\TripalField\ChadoFieldItemBase::isCompatible | ( | TripalEntityType | $entity_type | ) |
Indicates if the field is compatible with the content type.
This function should be implemented by all Chado-based fields and indicate if the field is compatible with the specified content type. By default, it returns TRUE.
| TripalEntityType | $entity_type |
Reimplemented in Drupal\tripal_chado\Plugin\Field\FieldType\ChadoAnalysisTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoArrayDesignTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoAssayTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoBiomaterialTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoBooleanTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoContactByRoleTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoContactTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoDbxrefTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoFeatureMapTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoFeatureTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoIntegerTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoOrganismTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoProjectTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoProtocolTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoRelationshipTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoSequenceChecksumTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoSequenceCoordinatesDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoSequenceLengthTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoSequenceTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoSourceDataTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoStockTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoStringTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoStudyTypeDefault, Drupal\tripal_chado\Plugin\Field\FieldType\ChadoSynonymTypeDefault, and Drupal\tripal_chado\Plugin\Field\FieldType\ChadoTextTypeDefault.
|
staticprotected |
Parse a combined table + column string into its two parts
| string | $table_and_column | Table and column delimited by self::table_column_delimiter, a right arrow by default, e.g."project → contact" |
|
protected |
Needed for Drupal ≤10.1 when an incompatible field was added to a content type, this will clean up the partially added field.
| string | $bundle | The bundle name. |
| string | $machine_name | The field identifier, including the 'field_' prefix. |
| Drupal\tripal_chado\TripalField\ChadoFieldItemBase::storageSettingsFormBaseTableAjaxCallback | ( | $form, | |
| & | $form_state | ||
| ) |
Ajax callback to update the base column select. The select can't be populated until we know the base table.
| array | $form | The form array. |
| \Drupal\Core\Form\FormStateInterface | $form_state | The form state object. |
| Drupal\tripal_chado\TripalField\ChadoFieldItemBase::storageSettingsFormLinkingMethodAjaxCallback | ( | $form, | |
| & | $form_state | ||
| ) |
Ajax callback to update the linking method select. The select can't be populated until we know the base table.
| array | $form | The form array. |
| \Drupal\Core\Form\FormStateInterface | $form_state | The form state object. |
|
static |
Form element validation handler for base table
| array | $form | The form where the settings form is being included in. |
| \Drupal\Core\Form\FormStateInterface | $form_state | The form state of the (entire) configuration form. |
|
static |
Form element validation handler for linking method (table + column)
| array | $form | The form where the settings form is being included in. |
| \Drupal\Core\Form\FormStateInterface | $form_state | The form state of the (entire) configuration form. |