Tripal
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Drupal\tripal\Plugin\TripalVocabulary\TripalDefaultVocabulary Class Reference
Inheritance diagram for Drupal\tripal\Plugin\TripalVocabulary\TripalDefaultVocabulary:
Inheritance graph
[legend]
Collaboration diagram for Drupal\tripal\Plugin\TripalVocabulary\TripalDefaultVocabulary:
Collaboration graph
[legend]

Public Member Functions

 __construct (array $configuration, $plugin_id, $plugin_definition)
 
 getIdSpaceNames ()
 
 getLabel ()
 
 recordExists ()
 
 isValid ()
 
 getNameSpace ()
 
 destroy ()
 
 getTerms ($name, $exact=True)
 
 setURL ($url)
 
 getURL ()
 
 setLabel ($label)
 
 createRecord ()
 
 addIdSpace ($idSpace)
 
 removeIdSpace ($idSpace)
 
- Public Member Functions inherited from Drupal\tripal\TripalVocabTerms\TripalCollectionPluginBase
 getName ()
 

Protected Member Functions

 loadVocab ()
 

Protected Attributes

 $messageLogger = NULL
 
 $is_valid = False
 
- Protected Attributes inherited from Drupal\tripal\TripalVocabTerms\TripalCollectionPluginBase
 $messageLogger = NULL
 

Detailed Description

Default implementation of the TripalVocabularyBase.

@TripalVocabulary( id = "tripal_default_vocabulary", label = @Translation("Deafult Tripal Vocabulary Plugin"), )

Constructor & Destructor Documentation

◆ __construct()

Drupal\tripal\Plugin\TripalVocabulary\TripalDefaultVocabulary::__construct ( array  $configuration,
  $plugin_id,
  $plugin_definition 
)

Member Function Documentation

◆ addIdSpace()

Drupal\tripal\Plugin\TripalVocabulary\TripalDefaultVocabulary::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.

Parameters
string$idSpaceThe id space collection name.
Returns
bool True on success or false otherwise.

Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalVocabularyInterface.

◆ createRecord()

Drupal\tripal\Plugin\TripalVocabulary\TripalDefaultVocabulary::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.

◆ destroy()

Drupal\tripal\Plugin\TripalVocabulary\TripalDefaultVocabulary::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.

◆ getIdSpaceNames()

Drupal\tripal\Plugin\TripalVocabulary\TripalDefaultVocabulary::getIdSpaceNames ( )

Returns list of id space collection names that is contained in this vocabulary.

Returns
array An array of id space collection name strings.

Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalVocabularyInterface.

◆ getLabel()

Drupal\tripal\Plugin\TripalVocabulary\TripalDefaultVocabulary::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.

Returns
string $label The name of the vocabulary.

Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalVocabularyInterface.

◆ getNameSpace()

Drupal\tripal\Plugin\TripalVocabulary\TripalDefaultVocabulary::getNameSpace ( )

Returns the namespace of the vocabulary

This should be identical to the name of the collection, and therefore, there is no setter function.

Returns
string $namespace The namespace of the vocabulary.

Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalVocabularyInterface.

◆ getTerms()

Drupal\tripal\Plugin\TripalVocabulary\TripalDefaultVocabulary::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.

Parameters
string$nameThe name.
bool$exactTrue to only include exact matches else include all substring matches.
Returns
array Array of matching Drupal\tripal\TripalVocabTerms\TripalTerm instances.
}}

Reimplemented from Drupal\tripal\TripalVocabTerms\TripalVocabularyBase.

◆ getURL()

Drupal\tripal\Plugin\TripalVocabulary\TripalDefaultVocabulary::getURL ( )

Returns the URL of this vocabulary.

Returns
string The URL.

Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalVocabularyInterface.

◆ isValid()

Drupal\tripal\Plugin\TripalVocabulary\TripalDefaultVocabulary::isValid ( )

Tests if this collection is valid or not.

Returns
bool True if this collection is valid or false otherwise.

Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalCollectionPluginInterface.

◆ loadVocab()

Drupal\tripal\Plugin\TripalVocabulary\TripalDefaultVocabulary::loadVocab ( )
protected

Loads the vocabulary record.

Returns
An associative array containing the list of vocabularies.

◆ recordExists()

Drupal\tripal\Plugin\TripalVocabulary\TripalDefaultVocabulary::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.

◆ removeIdSpace()

Drupal\tripal\Plugin\TripalVocabulary\TripalDefaultVocabulary::removeIdSpace (   $idSpace)

Removes the id space from this vocabulary with the given collection name.

Parameters
string$idSpaceThe id space collection name.
Returns
bool True on success or false otherwise.

Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalVocabularyInterface.

◆ setLabel()

Drupal\tripal\Plugin\TripalVocabulary\TripalDefaultVocabulary::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.

Parameters
string$labelThe name of the vocabulary.
Returns
bool True on success or false otherwise.
bool True if the value was set or false otherwise.

Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalVocabularyInterface.

◆ setURL()

Drupal\tripal\Plugin\TripalVocabulary\TripalDefaultVocabulary::setURL (   $url)

Sets the URL of this vocabulary to the given URL.

Parameters
string$urlThe URL.
Returns
bool True if the value was set or false otherwise.

Implements Drupal\tripal\TripalVocabTerms\Interfaces\TripalVocabularyInterface.


The documentation for this class was generated from the following file: