Tripal
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Drupal\tripal_chado\Database\ChadoSchema Class Reference
Inheritance diagram for Drupal\tripal_chado\Database\ChadoSchema:
Inheritance graph
[legend]
Collaboration diagram for Drupal\tripal_chado\Database\ChadoSchema:
Collaboration graph
[legend]

Public Member Functions

 getSchemaDef (array $parameters)
 
 getMainTables ()
 
 getDefault ()
 
- Public Member Functions inherited from Drupal\tripal\TripalDBX\TripalDbxSchema
 __construct (\Drupal\tripal\TripalDBX\TripalDbxConnection $connection)
 
 initialize ()
 
 getSchemaName ()
 
 findTables ($table_expression)
 
 queryTableInformation ($table)
 
 indexExists ($table, $index_name, bool $exact_name=FALSE)
 
 getSchemaSize ()
 
 schemaExists ()
 
 functionExists (string $function_name, array $function_parameters)
 
 sequenceExists (?string $table_name=NULL, ?string $column_name=NULL, ?string &$sequence_name=NULL)
 
 constraintExists ( $table, $constraint_name, ?string $type=NULL)
 
 primaryKeyExists (string $table, ?string $column=NULL)
 
 getForeignKeyDef (string $left_table, string $right_table)
 
 foreignKeyExists (string $left_table, string $right_table)
 
 foreignKeyConstraintExists (string $base_table, string $base_column)
 
 getTables (array $include=[])
 
 getTableDef (string $table, array $parameters)
 
 getTableDdl (string $table_name, bool $clear_cache=FALSE)
 
 getReferencingTables (string $table_name, bool $clear_cache=FALSE)
 
 createSchema ()
 
 cloneSchema (string $source_schema)
 
 renameSchema (string $new_schema_name)
 
 dropSchema ()
 
 tableExists ($table, $add_prefix=true)
 

Additional Inherited Members

- Protected Attributes inherited from Drupal\tripal\TripalDBX\TripalDbxSchema
 $defaultSchema = ''
 
 $quotedDefaultSchema = ''
 
 $initialized = FALSE
 
 $tripalDbxApi = NULL
 

Detailed Description

Chado schema class.

Member Function Documentation

◆ getDefault()

Drupal\tripal_chado\Database\ChadoSchema::getDefault ( )

Get information about which Chado base table a cvterm is mapped to.

Vocabulary terms that represent content types in Tripal must be mapped to Chado tables. A cvterm can only be mapped to one base table in Chado. This function will return an object that contains the chado table and foreign key field to which the cvterm is mapped. The 'chado_table' property of the returned object contains the name of the table, and the 'chado_field' property contains the name of the foreign key field (e.g. type_id), and the 'cvterm' property contains a cvterm object.

@params An associative array that contains the following keys:

  • cvterm_id: the cvterm ID value for the term.
  • vocabulary: the short name for the vocabulary (e.g. SO, GO, PATO)
  • accession: the accession for the term.
  • bundle_id: the ID for the bundle to which a term is associated. The 'vocabulary' and 'accession' must be used together, the 'cvterm_id' can be used on its own.
Returns
An object containing the chado_table and chado_field properties or NULL if if no mapping was found for the term.

public function getCvtermMapping($params) { return chado_get_cvterm_mapping($params); }

◆ getMainTables()

Drupal\tripal_chado\Database\ChadoSchema::getMainTables ( )

Returns all chado base tables.

Base tables are those that contain the primary record for a data type. For example, feature, organism, stock, are all base tables. Other tables include linker tables (which link two or more base tables), property tables, and relationship tables. These provide additional information about primary data records and are therefore not base tables. This function retrieves only the list of tables that are considered 'base' tables.

Returns
An array of base table names.

◆ getSchemaDef()

Drupal\tripal_chado\Database\ChadoSchema::getSchemaDef ( array  $parameters)

{Retrieve schema details from selected source in the requested format.

Parameters
array$parametersAn array of key-value parameters:
  • 'source': either 'database' to extract data from database or 'file' to get the data from a static YAML file. Default: 'file'.
  • 'version': version of the Tripal DBX managed schema to fetch from a file. Ignored for 'database' source. Default: implementation specific.
  • 'format': return format, either 'SQL' for an array of SQL string, 'Drupal' for Drupal schema API, 'none' to return nothing or anything else to provide a data structure as returned by TripalDbx::parseTableDdl. If the selected source is 'file', the format parameter will be ignored and 'Drupal' format will be used. Default: TripalDbx::parseTableDdl data structure structure.
  • 'clear': if not empty, cache will be cleared.
Returns
An array with details for the current schema version as defined by $parameters values.
Exceptions

Drupal\tripal\TripalDBX\Exceptions\SchemaException}

Reimplemented from Drupal\tripal\TripalDBX\TripalDbxSchema.


The documentation for this class was generated from the following file: