Tripal
|
Public Member Functions | |
__construct (array $configuration, $plugin_id, $plugin_definition, TripalLogger $logger, ChadoConnection $connection) | |
isValid () | |
recordExists () | |
createRecord () | |
destroy () | |
getParent ($child) | |
getChildren ($parent=NULL) | |
getTerm ($accession, $options=[]) | |
getTerms ($name, $options=[]) | |
getDefaultVocabulary () | |
saveTerm ($term, $options=[]) | |
removeTerm ($accession) | |
getURLPrefix () | |
setURLPrefix ($prefix) | |
getDescription () | |
setDescription ($description) | |
setDefaultVocabulary ($name) | |
![]() | |
__construct (array $configuration, $plugin_id, $plugin_definition) | |
![]() | |
getName () | |
![]() | |
saveTerm (TripalTerm $term, array $options=[]) | |
Static Public Member Functions | |
static | create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) |
Protected Member Functions | |
loadIdSpace () | |
getChadoCV (TripalTerm $term) | |
getChadoDB (TripalTerm $term) | |
getChadoDBXref (TripalTerm $term) | |
getChadoDBXrefbyTermID (string $term_id) | |
insertChadoDBxrefbyTermID (string $term_id) | |
getChadoCVTerm (TripalTerm $term) | |
insertTerm (TripalTerm $term, $options) | |
saveTermAttributes (TripalTerm $term, object $cvterm, array $options) | |
updateTerm (TripalTerm $term, object &$cvterm, array $options) | |
getDefaultVocabCache () | |
setDefaultVocabCache ($vocabulary) | |
Protected Attributes | |
$default_vocabulary = NULL | |
$db_def = NULL | |
$messageLogger = NULL | |
$connection | |
$is_valid = False | |
![]() | |
$messageLogger = NULL | |
Chado Implementation of TripalIdSpaceBase
@TripalIdSpace( id = "chado_id_space", label = @Translation("Vocabulary IDSpace in Chado"), )
Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::__construct | ( | array | $configuration, |
$plugin_id, | |||
$plugin_definition, | |||
TripalLogger | $logger, | ||
ChadoConnection | $connection | ||
) |
{}
|
static |
Implements ContainerFactoryPluginInterface->create().
Since we have implemented the ContainerFactoryPluginInterface this static function will be called behind the scenes when a Plugin Manager uses createInstance(). Specifically this method is used to determine the parameters to pass to the contructor.
\Symfony\Component\DependencyInjection\ContainerInterface | $container | |
array | $configuration | |
string | $plugin_id | |
mixed | $plugin_definition |
Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::createRecord | ( | ) |
{Creates the records needed for this collection.This must only be called once on this new collection instance that has just been created by its collection plugin manager.}
Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalCollectionPluginInterface.
Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::destroy | ( | ) |
{Destroys this collection.This must only be called once when on this existing collection that is being removed from its collection plugin manager.}
Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalCollectionPluginInterface.
|
protected |
Retrieve a record from the Chado cv table.
TripalTerm | $term | The TripalTerm object to save. |
|
protected |
Retrieve a record from the Chado cvterm table.
This function uses the db.name (IdSpace), cv.name (vocabulary) and dbxref.accession values to uniquely identify a term in Chado.
TripalTerm | $term | The TripalTerm object to save. |
|
protected |
Retrieve a record from the Chado db table.
TripalTerm | $term | The TripalTerm object to save. |
|
protected |
Retrieve a record from the Chado dbxref table.
TripalTerm | $term | The TripalTerm object to save. |
|
protected |
Retreives a record from the Cahdo dbxref table using the term ID.
string | $term_id | The term ID (e.g. GO:0044708). |
Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::getChildren | ( | $parent = NULL | ) |
{Gets the children terms of the given term. The given term must be a valid term for this id space or NULL. If the given term is NULL then the root children of this id space is returned.
Drupal\tripal\TripalVocabTerms\TripalTerm | NULL | $parent | The given term or NULL. |
Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalIdSpaceInterface.
|
protected |
Retrieves from the Drupal cache the default vocabulary for this space.
Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::getDefaultVocabulary | ( | ) |
{Returns this id space's default vocabulary name or NULL if no default has been set.
Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalIdSpaceInterface.
Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::getDescription | ( | ) |
{Returns the description of this id space.
Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalIdSpaceInterface.
Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::getParent | ( | $child | ) |
{Gets the parent of the given term. The given term must be a valid term for this id space. If the given term is a root of this id space then NULL is returned.
Drupal\tripal\TripalVocabTerms\TripalTerm | $child | The given term. |
Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalIdSpaceInterface.
Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::getTerm | ( | $accession, | |
$options = [] |
|||
) |
{Returns the term in this id space with the given accession.If no such term exists then NULL is returned.The given options array has the following recognized keys:includes(array): A list of attribute names to include with the term object. The attribute names can be: 'parents', 'altIds', 'synonyms' 'properties'. If the key is missing then all attributes will be loaded. If present but empty then only basic attributes will be loaded (e.g. name, definition, etc.). The purpose of this attribute is to save time loading when not all attributes are needed.
string | $accession | The accession. |
array | NULL | $options | The options array. |
Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalIdSpaceInterface.
Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::getTerms | ( | $name, | |
$options = [] |
|||
) |
{Returns terms whose names match the given arguments.Term can be matched on their name or synonyms. If the provided $name argument matches both the name and a synonym of the same term then both matches will be returned.The given options array has the following recognized keys:exact(boolean): True to only include exact matches else false to include all substring matches. The default is false.
string | $name | The name. |
array | $options | The options array. |
Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalIdSpaceInterface.
Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::getURLPrefix | ( | ) |
{Returns the URL prefix of this id space.
Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalIdSpaceInterface.
|
protected |
Adds a record from the Cahdo dbxref table using the term ID.
The database record must already exist.
string | $term_id | The term ID (e.g. GO:0044708). |
|
protected |
Inserts a new term into Chado.
The term should be checked that it does not exist prior to calling this function.
Drupal\tripal\TripalVocabTerms\TripalTerm | $term | The term object to update |
array | $options | The options passed to the saveTerm() function. |
Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::isValid | ( | ) |
{Tests if this collection is valid or not.
Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalCollectionPluginInterface.
|
protected |
Loads an ID Space record from Chado.
This function queries the db
table of Chado to get the values for the ID space.
Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::recordExists | ( | ) |
{Indicates if the underlying data store has a record for this collection.This function will be called by the collection plugin manager to ensure that the record for this collection exists and if not allow it to create it by calling the create() method or prevent addition of duplicate entries.
Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalCollectionPluginInterface.
Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::removeTerm | ( | $accession | ) |
{Removes the term with the given accession from this id space. All children terms are also removed. !!!WARNING!!! If the removed term in this id space is referenced by entities this could break data integrity. This method must be used with extreme caution!
string | $accession | The accession. |
Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalIdSpaceInterface.
Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::saveTerm | ( | $term, | |
$options = [] |
|||
) |
{}
|
protected |
TripalTerm | $term | |
object | $cvterm | |
array | $options |
|
protected |
Sets in the Drupal cache the default vocabulary.
string | $vocabulary | The default vocabulary name. |
Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::setDefaultVocabulary | ( | $name | ) |
{{Sets the default vocabulary of this id space to the given vocabulary name.Removes this id space from its previous default vocabulary if one is set and then adds this id space to its new default vocabulary if the given name is not NULL. It is still the responsibility of an implementation to actually save changes to its default vocabulary.
string | name The vocabulary name. |
Reimplemented from Drupal\tripal\TripalVocabTerms\TripalIdSpaceBase.
Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::setDescription | ( | $description | ) |
{Sets the description of this id space.
string | $description | The description. |
Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalIdSpaceInterface.
Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::setURLPrefix | ( | $prefix | ) |
{Sets the URL prefix of this id space to the given URL prefix.
string | $prefix | The URL prefix. |
Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalIdSpaceInterface.
|
protected |
Updates an existing term in Chado.
The term should be checked that it already exists prior to execution of this function.
Drupal\tripal\TripalVocabTerms\TripalTerm | $term | The term object to update |
object | $cvterm | The record object for the term to update from the Chado cvterm table. |
array | $options | The options passed to the saveTerm() function. |