Tripal
|
Public Member Functions | |
__construct ($table_name, string $chado_schema=NULL) | |
getTableId () | |
getTableName () | |
getChadoSchema () | |
setHidden ($hide=False) | |
isHidden () | |
getTableSchema () | |
setTableSchema ($table_schema, $force=False) | |
delete () | |
Static Public Member Functions | |
static | validateTableSchema ($table_schema) |
Protected Member Functions | |
getChado () | |
Drupal\tripal_chado\ChadoCustomTables\ChadoCustomTable::__construct | ( | $table_name, | |
string | $chado_schema = NULL |
||
) |
Initializes the service object with a table name.
This object will work with the custom table in the default Chado schema. Be sure to call the setSchemaName() on the ChadoConnection object to ensure the custom table is managed in the correct Chado instance.
string | $table_name | The name of the custom table. |
string | $chado_schema | Optional. The chado schema where the custom table will live. If no schema is specified then the default schema is used. |
Reimplemented in Drupal\tripal_chado\ChadoCustomTables\ChadoMview.
Drupal\tripal_chado\ChadoCustomTables\ChadoCustomTable::delete | ( | ) |
Destroyes the custom table completely.
Tripal will no longer know about the table and the table will be removed from Chado. After this function is executed this object is no longer usable.
|
protected |
Returns a ChadoConnection object with the correct schema set.
This is just a helpder function for this class to make sure the Chado schema is set as requested anytime the object is needec.
Drupal\tripal_chado\ChadoCustomTables\ChadoCustomTable::getChadoSchema | ( | ) |
Retrieves the name of the Chado schema in which this table lives.
Drupal\tripal_chado\ChadoCustomTables\ChadoCustomTable::getTableId | ( | ) |
Retrieves the numeric ID of the custom table.
Drupal\tripal_chado\ChadoCustomTables\ChadoCustomTable::getTableName | ( | ) |
Retrieves the name of the custom table.
Drupal\tripal_chado\ChadoCustomTables\ChadoCustomTable::getTableSchema | ( | ) |
Retrieves the schema for the custom table.
If return value is empty then it means the table schema has not yet been provided or the init() function has not been called. Use the setTableSchema() function to provide one.
Drupal\tripal_chado\ChadoCustomTables\ChadoCustomTable::isHidden | ( | ) |
Indicates if the custom table is hidden from the end-user.
Tables that are hidden are meant to be managed internally by the Tripal module that created it and should not be changed or deleted by the end-user.
Drupal\tripal_chado\ChadoCustomTables\ChadoCustomTable::setHidden | ( | $hide = False | ) |
Toggles the custom table's hidden stuats.
Tables that are hidden are meant to be managed internally by the Tripal module that created it and should not be changed or deleted by the end-user.
bool | $hide | Set to True to hide the table. Set to False to show the table to the end-user. |
Drupal\tripal_chado\ChadoCustomTables\ChadoCustomTable::setTableSchema | ( | $table_schema, | |
$force = False |
|||
) |
Sets the table schema.
When setting the table schema, the table will be created in the Chado schema if it doesn't exist. If the table does exist then the $force argument must be set to True and the table will be dropped and recreated. If not set to True then no change is made to the schema or the custom table. The force argument is to prevent accidental deletion and recreation of tables that may have data.
If a mistake was made in the schema definition and it needs correction make sure the $force argument is set to False. But be careful. If the schema does not properly match the table problems may occur when using the table later.
array | $schema | The Drupal table schema array defining the table. |
boolean | $force | True if the custom table should be dropped and recreated if it already exists |
Reimplemented in Drupal\tripal_chado\ChadoCustomTables\ChadoMview.
|
static |
Ensures that the table schema is correctly formatted.
Returns a list of messages indicating if any errors are present.
string | $table_schema | The Drupal table schema array defining the table. |