◆ __construct()
Drupal\tripal_chado\ChadoCustomTables\ChadoMview::__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.
- Parameters
-
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 from Drupal\tripal_chado\ChadoCustomTables\ChadoCustomTable.
◆ comment()
Drupal\tripal_chado\ChadoCustomTables\ChadoMview::comment |
( |
| ) |
|
Retrieves the comment for materialized view.
- Returns
- string
◆ destroy()
Drupal\tripal_chado\ChadoCustomTables\ChadoMview::destroy |
( |
| ) |
|
Destroyes the materialized view 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.
Note: if the materialized view exists in multiple Chado instnaces then it will only be removed from the default instance and will not be removed in any other instance. Be sure to call the setSchemaName() on the ChadoConnection object to ensure the view is deleted in the correct Chado instance.
- Returns
- bool True if successful. False otherwise.
◆ getLastUpdate()
Drupal\tripal_chado\ChadoCustomTables\ChadoMview::getLastUpdate |
( |
| ) |
|
Retrieves the timestamp for the last time the mview was populated.
- Returns
- int
◆ getSqlQuery()
Drupal\tripal_chado\ChadoCustomTables\ChadoMview::getSqlQuery |
( |
| ) |
|
Retrieves the SQL query used to populate the materialized view.
- Returns
- string
◆ getStatus()
Drupal\tripal_chado\ChadoCustomTables\ChadoMview::getStatus |
( |
| ) |
|
Retrieves the the status of the last time the mview was populated.
- Returns
- string
◆ populate()
Drupal\tripal_chado\ChadoCustomTables\ChadoMview::populate |
( |
| ) |
|
Populates the materialized view with rows of data.
- Returns
- bool True if successful. False otherwise.
◆ setComment()
Drupal\tripal_chado\ChadoCustomTables\ChadoMview::setComment |
( |
string |
$comment | ) |
|
Sets the comment for the materialized view.
The comment should describe to others the puporse of the table and perhaps the data used to populate it.
- Parameters
-
string | $comment | The comment for the materialized view. |
- Returns
- bool True if successful. False otherwise.
◆ setLastUpdate()
Drupal\tripal_chado\ChadoCustomTables\ChadoMview::setLastUpdate |
( |
int |
$timestamp | ) |
|
Sets the last update for the materialized view.
- Parameters
-
int | $timestamp | The UNIX timestamp. |
- Returns
- bool True if successful. False otherwise.
◆ setSqlQuery()
Drupal\tripal_chado\ChadoCustomTables\ChadoMview::setSqlQuery |
( |
string |
$query | ) |
|
Sets the query used to populate the materialized view.
- Parameters
-
string | $query | The SQL query used to populate the materialized view. |
◆ setTableSchema()
Drupal\tripal_chado\ChadoCustomTables\ChadoMview::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.
- Parameters
-
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 |
- Returns
- boolean True on successfu
- See also
- \Drupal\tripal_chado\ChadoCustomTables\ChadoCustomTable::setTableSchema()
Reimplemented from Drupal\tripal_chado\ChadoCustomTables\ChadoCustomTable.
The documentation for this class was generated from the following file:
- tripal_chado/src/ChadoCustomTables/ChadoMview.php