Tripal
Public Member Functions | List of all members
Drupal\tripal_chado\ChadoCustomTables\ChadoMview Class Reference
Inheritance diagram for Drupal\tripal_chado\ChadoCustomTables\ChadoMview:
Inheritance graph
[legend]
Collaboration diagram for Drupal\tripal_chado\ChadoCustomTables\ChadoMview:
Collaboration graph
[legend]

Public Member Functions

 __construct ($table_name, string $chado_schema=NULL)
 
 getMviewId ()
 
 setTableSchema ($table_schema, $force=False)
 
 setSqlQuery (string $query)
 
 getSqlQuery ()
 
 getStatus ()
 
 getLastUpdate ()
 
 setLastUpdate (int $timestamp)
 
 setComment (string $comment)
 
 comment ()
 
 populate ()
 
 destroy ()
 
- Public Member Functions inherited from Drupal\tripal_chado\ChadoCustomTables\ChadoCustomTable
 getTableId ()
 
 getTableName ()
 
 getChadoSchema ()
 
 setHidden ($hide=False)
 
 isHidden ()
 
 getTableSchema ()
 
 delete ()
 

Additional Inherited Members

- Static Public Member Functions inherited from Drupal\tripal_chado\ChadoCustomTables\ChadoCustomTable
static validateTableSchema ($table_schema)
 
- Protected Member Functions inherited from Drupal\tripal_chado\ChadoCustomTables\ChadoCustomTable
 getChado ()
 

Constructor & Destructor Documentation

◆ __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_nameThe name of the custom table.
string$chado_schemaOptional. 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.

Member Function Documentation

◆ 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$commentThe 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$timestampThe 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$queryThe 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$schemaThe Drupal table schema array defining the table.
boolean$forceTrue 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: