|
| | __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 | create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) |
| |
|
|
| $default_vocabulary = NULL |
| |
|
| $db_def = NULL |
| |
|
array null | $chado_record = NULL |
| |
|
| $messageLogger = NULL |
| |
|
| $connection |
| |
|
| $is_valid = FALSE |
| |
|
| $messageLogger = NULL |
| |
◆ __construct()
| Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::__construct |
( |
array |
$configuration, |
|
|
|
$plugin_id, |
|
|
|
$plugin_definition, |
|
|
TripalLogger |
$logger, |
|
|
ChadoConnection |
$connection |
|
) |
| |
◆ create()
| static Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::create |
( |
ContainerInterface |
$container, |
|
|
array |
$configuration, |
|
|
|
$plugin_id, |
|
|
|
$plugin_definition |
|
) |
| |
|
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 constructor.
- Parameters
-
| \Symfony\Component\DependencyInjection\ContainerInterface | $container | The container. |
| array | $configuration | The plugin configuration. |
| string | $plugin_id | The plugin id. |
| mixed | $plugin_definition | The plugin definition. |
- Returns
- static
◆ createRecord()
| Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::createRecord |
( |
| ) |
|
◆ destroy()
| Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::destroy |
( |
| ) |
|
◆ getChadoCV()
| Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::getChadoCV |
( |
TripalTerm |
$term | ) |
|
|
protected |
Retrieve a record from the Chado cv table.
- Parameters
-
| \Drupal\tripal\TripalVocabTerms\TripalTerm | $term | The TripalTerm object to save. |
- Returns
- object The cv record in object form.
◆ getChadoCVTerm()
| Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::getChadoCVTerm |
( |
TripalTerm |
$term | ) |
|
|
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.
- Parameters
-
| \Drupal\tripal\TripalVocabTerms\TripalTerm | $term | The TripalTerm object to save. |
- Returns
- object The cvterm record in object form.
◆ getChadoDB()
| Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::getChadoDB |
( |
TripalTerm |
$term | ) |
|
|
protected |
Retrieve a record from the Chado db table.
- Parameters
-
| \Drupal\tripal\TripalVocabTerms\TripalTerm | $term | The TripalTerm object to save. |
- Returns
- object The db record in object form.
◆ getChadoDBXref()
| Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::getChadoDBXref |
( |
TripalTerm |
$term | ) |
|
|
protected |
Retrieve a record from the Chado dbxref table.
- Parameters
-
| \Drupal\tripal\TripalVocabTerms\TripalTerm | $term | The TripalTerm object to save. |
- Returns
- object The dbxref record in object form.
◆ getChadoDBXrefbyTermID()
| Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::getChadoDBXrefbyTermID |
( |
string |
$term_id | ) |
|
|
protected |
Retrieves a record from the Cahdo dbxref table using the term ID.
- Parameters
-
| string | $term_id | The term ID (e.g. GO:0044708). |
◆ getChildren()
| 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.
- Parameters
-
| Drupal\tripal\TripalVocabTerms\TripalTerm | NULL | $parent | The given term or NULL. |
- Returns
- array An array of children terms where each entry is a tuples and the first element of the tuple is a Drupal\tripal\TripalVocabTerms\TripalTerm child object and the second is the a Drupal\tripal\TripalVocabTerms\TripalTerm relationship type term.
}
Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalIdSpaceInterface.
◆ getDefaultVocabCache()
| Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::getDefaultVocabCache |
( |
| ) |
|
|
protected |
Retrieves from the Drupal cache the default vocabulary for this space.
- Returns
- string The deffault vocabulary name.
◆ getDefaultVocabulary()
| Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::getDefaultVocabulary |
( |
| ) |
|
◆ getDescription()
| Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::getDescription |
( |
| ) |
|
◆ getParent()
| 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.
- Parameters
-
| Drupal\tripal\TripalVocabTerms\TripalTerm | $child | The given term. |
- Returns
- Drupal\tripal\TripalVocabTerms\TripalTerm|NULL The parent term or NULL.
}
Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalIdSpaceInterface.
◆ getTerm()
| 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.
- Parameters
-
| string | $accession | The accession. |
| array | NULL | $options | The options array. |
- Returns
- Drupal\tripal\TripalVocabTerms\TripalTerm|NULL The term or NULL.
}
Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalIdSpaceInterface.
◆ getTerms()
| 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.
- Parameters
-
| string | $name | The name. |
| array | $options | The options array. |
- Returns
- array Associative array of matching terms. The first-level key is the full string that matched the provided name. The second-level key is the term ID (e.g. GO:0044708) and the value is an the
Drupal\tripal\TripalVocabTerms\TripalTerm term. These terms will only have these attributes loaded: name, definition, accession, idSpace and vocabulary.
}
Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalIdSpaceInterface.
◆ getURLPrefix()
| Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::getURLPrefix |
( |
| ) |
|
◆ insertChadoDBxrefbyTermID()
| Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::insertChadoDBxrefbyTermID |
( |
string |
$term_id | ) |
|
|
protected |
Adds a record from the Cahdo dbxref table using the term ID.
The database record must already exist.
- Parameters
-
| string | $term_id | The term ID (e.g. GO:0044708). |
- Returns
- object|null The dbxref Object.
◆ insertTerm()
| Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::insertTerm |
( |
TripalTerm |
$term, |
|
|
|
$options |
|
) |
| |
|
protected |
Inserts a new term into Chado.
The term should be checked that it does not exist prior to calling this function.
- Parameters
-
| Drupal\tripal\TripalVocabTerms\TripalTerm | $term | The term object to update. |
| array | $options | The options passed to the saveTerm() function. |
- Returns
- bool True if the insert was successful, false otherwise.
◆ isValid()
| Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::isValid |
( |
| ) |
|
◆ loadIdSpace()
| Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::loadIdSpace |
( |
bool |
$force_reload = TRUE | ) |
|
|
protected |
Loads an ID Space record from Chado.
This function queries the db table of Chado to get the values for the ID space.
- Parameters
-
| bool | $force_reload | If true the record will always be loaded from chado, if false the cache will be used if it exists. |
- Returns
- array An associative array containing the columns of the `db1 table of Chado or NULL if the db could not be found.
◆ recordExists()
| 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.
- Returns
- bool True if a record exists in the data store, False if not.
}
Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalCollectionPluginInterface.
◆ removeTerm()
| 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!
- Parameters
-
| string | $accession | The accession. |
- Returns
- bool True if the term was removed or false otherwise.
}
Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalIdSpaceInterface.
◆ saveTerm()
| Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::saveTerm |
( |
|
$term, |
|
|
|
$options = [] |
|
) |
| |
◆ saveTermAttributes()
| Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::saveTermAttributes |
( |
TripalTerm |
$term, |
|
|
object |
$cvterm, |
|
|
array |
$options |
|
) |
| |
|
protected |
Saves term attributes.
- Parameters
-
| \Drupal\tripal\TripalVocabTerms\TripalTerm | $term | The term whose attributes should be saved. |
| object | $cvterm | The cvterm mapping to this term. |
| array | $options | Options for how to save these attributes. |
- Returns
- bool TRUE if successful, FALSE otherwise.
◆ setDefaultVocabCache()
| Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::setDefaultVocabCache |
( |
|
$vocabulary | ) |
|
|
protected |
Sets in the Drupal cache the default vocabulary.
- Parameters
-
| string | $vocabulary | The default vocabulary name. |
◆ setDefaultVocabulary()
| 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.
- Parameters
-
| string | name The vocabulary name. |
- Returns
- bool True on success or false otherwise.
}}
Reimplemented from Drupal\tripal\TripalVocabTerms\TripalIdSpaceBase.
◆ setDescription()
| Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::setDescription |
( |
|
$description | ) |
|
◆ setURLPrefix()
| Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::setURLPrefix |
( |
|
$prefix | ) |
|
◆ updateTerm()
| Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace::updateTerm |
( |
TripalTerm |
$term, |
|
|
object & |
$cvterm, |
|
|
array |
$options |
|
) |
| |
|
protected |
Updates an existing term in Chado.
The term should be checked that it already exists prior to execution of this function.
- Parameters
-
| 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. |
- Returns
- bool True if the update was successful, false otherwise.
The documentation for this class was generated from the following file:
- tripal_chado/src/Plugin/TripalIdSpace/ChadoIdSpace.php