Tripal
|
Public Member Functions | |
getParent ($child) | |
getChildren ($parent=NULL) | |
getTerm ($accession, $options=[]) | |
getTerms ($name, $options=[]) | |
setDefaultVocabulary ($name) | |
getDefaultVocabulary () | |
saveTerm (TripalTerm $term, array $options=[]) | |
removeTerm ($accession) | |
getURLPrefix () | |
setURLPrefix ($prefix) | |
getDescription () | |
setDescription ($description) | |
![]() | |
createRecord () | |
destroy () | |
isValid () | |
recordExists () | |
Defines an interface for tripal id space plugins.
Drupal\tripal\TripalVocabTerms\Interfaces\TripalIdSpaceInterface::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. |
Implemented in Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace.
Drupal\tripal\TripalVocabTerms\Interfaces\TripalIdSpaceInterface::getDefaultVocabulary | ( | ) |
Returns this id space's default vocabulary name or NULL if no default has been set.
Implemented in Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace, and Drupal\tripal\Plugin\TripalIdSpace\TripalDefaultIdSpace.
Drupal\tripal\TripalVocabTerms\Interfaces\TripalIdSpaceInterface::getDescription | ( | ) |
Returns the description of this id space.
Implemented in Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace, and Drupal\tripal\Plugin\TripalIdSpace\TripalDefaultIdSpace.
Drupal\tripal\TripalVocabTerms\Interfaces\TripalIdSpaceInterface::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. |
Implemented in Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace, and Drupal\tripal\Plugin\TripalIdSpace\TripalDefaultIdSpace.
Drupal\tripal\TripalVocabTerms\Interfaces\TripalIdSpaceInterface::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. |
Implemented in Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace.
Drupal\tripal\TripalVocabTerms\Interfaces\TripalIdSpaceInterface::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. |
Implemented in Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace.
Drupal\tripal\TripalVocabTerms\Interfaces\TripalIdSpaceInterface::getURLPrefix | ( | ) |
Returns the URL prefix of this id space.
Implemented in Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace, and Drupal\tripal\Plugin\TripalIdSpace\TripalDefaultIdSpace.
Drupal\tripal\TripalVocabTerms\Interfaces\TripalIdSpaceInterface::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. |
Implemented in Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace, and Drupal\tripal\Plugin\TripalIdSpace\TripalDefaultIdSpace.
Drupal\tripal\TripalVocabTerms\Interfaces\TripalIdSpaceInterface::saveTerm | ( | TripalTerm | $term, |
array | $options = [] |
||
) |
Saves a term to its ID space data store.
If a term is new in the ID space and has no parents then it will be considered a "root" term for the vocabulary. If the term has parents, use the addParents()
function to add them before calling this function. If the term is not new and already exists you only need to provide parents if you need to change the parentage. If the updateParent
option is True then all parents of an existing term will be removed and will be updated to the parents provided. If updateParent
is False and no parents are provided then no change is made to the parent relationships.
The options array accepts the following recognized keys:
failIfExists(boolean): True to force this method to fail if this term already exists else false to update this term if it already exists. The default is false.
updateParent(boolean): True to update this term's parent to the one given or false to not update this existing term's parent. If this term is new this has no effect. The default is false.
TripalTerm | $term | The TripalTerm object to save. |
array | $options | An associative array of options. |
Drupal\tripal\TripalVocabTerms\Interfaces\TripalIdSpaceInterface::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. |
Implemented in Drupal\tripal\Plugin\TripalIdSpace\TripalDefaultIdSpace, Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace, and Drupal\tripal\TripalVocabTerms\TripalIdSpaceBase.
Drupal\tripal\TripalVocabTerms\Interfaces\TripalIdSpaceInterface::setDescription | ( | $description | ) |
Sets the description of this id space.
string | $description | The description. |
Implemented in Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace, and Drupal\tripal\Plugin\TripalIdSpace\TripalDefaultIdSpace.
Drupal\tripal\TripalVocabTerms\Interfaces\TripalIdSpaceInterface::setURLPrefix | ( | $prefix | ) |
Sets the URL prefix of this id space to the given URL prefix.
string | $prefix | The URL prefix. |
Implemented in Drupal\tripal_chado\Plugin\TripalIdSpace\ChadoIdSpace, and Drupal\tripal\Plugin\TripalIdSpace\TripalDefaultIdSpace.