Tripal
|
Public Member Functions | |
__construct (array $configuration, $plugin_id, $plugin_definition, TripalLogger $logger, ChadoConnection $connection) | |
isValid () | |
recordExists () | |
createRecord () | |
destroy () | |
getIdSpaceNames () | |
addIdSpace ($idSpace) | |
removeIdSpace ($idSpace) | |
getTerms ($name, $exact=True) | |
getURL () | |
setURL ($url) | |
getNameSpace () | |
setLabel ($label) | |
getLabel () | |
![]() | |
__construct (array $configuration, $plugin_id, $plugin_definition) | |
![]() | |
getName () | |
Static Public Member Functions | |
static | create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) |
Protected Member Functions | |
loadVocab () | |
getIdSpaceCacheID () | |
setIdSpacesCache ($id_spaces) | |
getIdSpacesCache () | |
Protected Attributes | |
$db_def = NULL | |
$cv_def = NULL | |
$messageLogger = NULL | |
$connection | |
$is_valid = False | |
![]() | |
$messageLogger = NULL | |
Chado implementation of the TripalVocabularyBase.
@TripalVocabulary( id = "chado_vocabulary", label = @Translation("Vocabulary in Chado"), )
Drupal\tripal_chado\Plugin\TripalVocabulary\ChadoVocabulary::__construct | ( | array | $configuration, |
$plugin_id, | |||
$plugin_definition, | |||
TripalLogger | $logger, | ||
ChadoConnection | $connection | ||
) |
{}
Drupal\tripal_chado\Plugin\TripalVocabulary\ChadoVocabulary::addIdSpace | ( | $idSpace | ) |
{Adds the id space with the given collection name to this vocabulary. The given collection name must be a valid id space collection.
string | $idSpace | The id space collection name. |
Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalVocabularyInterface.
|
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\TripalVocabulary\ChadoVocabulary::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\TripalVocabulary\ChadoVocabulary::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 |
Returns the IDSpace cache ID.
Drupal\tripal_chado\Plugin\TripalVocabulary\ChadoVocabulary::getIdSpaceNames | ( | ) |
{Returns list of id space collection names that is contained in this vocabulary.
Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalVocabularyInterface.
|
protected |
Retrieves from the Drupal cache the ID spaces of this vocabulary.
The current way to map CV's to DB's is to use the cv2db
materialized view but there is no guarantee that that mview is up-to-date and it would take too long to force an update every time we need to get the ID spaces for a vocabulary. This function retrieves the ID spaces for a vocabulary from a Drupal cache.
Drupal\tripal_chado\Plugin\TripalVocabulary\ChadoVocabulary::getLabel | ( | ) |
{Returns the label of the vocabulary.This is the human readable proper name of the vocabulary.Note that the name of the collection serves as the namespace of the vocabulary.
Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalVocabularyInterface.
Drupal\tripal_chado\Plugin\TripalVocabulary\ChadoVocabulary::getNameSpace | ( | ) |
Returns the namespace of the vocabulary
This should be identical to the name of the collection, and therefore, there is no setter function.
Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalVocabularyInterface.
Drupal\tripal_chado\Plugin\TripalVocabulary\ChadoVocabulary::getTerms | ( | $name, | |
$exact = True |
|||
) |
{{Returns the terms in this vocabulary whose names match the given name. Matches can only be exact or a substring depending on the given flag. The default is to only return exact matches.
string | $name | The name. |
bool | $exact | True to only include exact matches else include all substring matches. |
Reimplemented from Drupal\tripal\TripalVocabTerms\TripalVocabularyBase.
Drupal\tripal_chado\Plugin\TripalVocabulary\ChadoVocabulary::getURL | ( | ) |
{Returns the URL of this vocabulary.
Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalVocabularyInterface.
Drupal\tripal_chado\Plugin\TripalVocabulary\ChadoVocabulary::isValid | ( | ) |
{Tests if this collection is valid or not.
Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalCollectionPluginInterface.
|
protected |
Loads a Vocabulary record from Chado.
This function queries the cv
table of Chado to get the values for the vocabulary.
Drupal\tripal_chado\Plugin\TripalVocabulary\ChadoVocabulary::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\TripalVocabulary\ChadoVocabulary::removeIdSpace | ( | $idSpace | ) |
{Removes the id space from this vocabulary with the given collection name.
string | $idSpace | The id space collection name. |
Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalVocabularyInterface.
|
protected |
Sets the ID spaces for this vocabulary in the Drupal cache.
The current way to map CV's to DB's is to use the cv2db
materialized view but there is no guarantee that that mview is up-to-date and it would take too long to force an update every time we need to get the ID spaces for a vocabulary. This function caches it.
$id_spaces | An array containing the names of the ID spaces. |
Drupal\tripal_chado\Plugin\TripalVocabulary\ChadoVocabulary::setLabel | ( | $label | ) |
{Sets the label for the vocabulary.This is the human readable proper name of the vocabulary.Note that the name of the collection serves as the namespace of the vocabulary.
string | $label | The name of the vocabulary. |
Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalVocabularyInterface.
Drupal\tripal_chado\Plugin\TripalVocabulary\ChadoVocabulary::setURL | ( | $url | ) |
{Sets the URL of this vocabulary to the given URL.
string | $url | The URL. |
Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalVocabularyInterface.