Tripal
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Drupal\tripal\TripalVocabTerms\PluginManagers\TripalCollectionPluginManager Class Reference
Inheritance diagram for Drupal\tripal\TripalVocabTerms\PluginManagers\TripalCollectionPluginManager:
Inheritance graph
[legend]
Collaboration diagram for Drupal\tripal\TripalVocabTerms\PluginManagers\TripalCollectionPluginManager:
Collaboration graph
[legend]

Public Member Functions

 __construct ( $subdir,\Traversable $namespaces, ModuleHandlerInterface $module_handler, $plugin_interface, $plugin_definition_attribute_name, $table)
 
 createCollection ($name, $pluginId)
 
 removeCollection (string $name, bool $delete_backend=FALSE)
 
 getCollectionList ()
 
 loadCollection ($name, string $pluginId='')
 

Detailed Description

Provides a tripal collection plugin manager.

Constructor & Destructor Documentation

◆ __construct()

Drupal\tripal\TripalVocabTerms\PluginManagers\TripalCollectionPluginManager::__construct (   $subdir,
\Traversable  $namespaces,
ModuleHandlerInterface  $module_handler,
  $plugin_interface,
  $plugin_definition_attribute_name,
  $table 
)

Constructs a new tripal collection plugin manager.

Parameters
string$subdirThe plugin's subdirectory, for example Plugin/views/filter.
\Traversable$namespacesAn object that implements \Traversable which contains the root paths keyed by the corresponding namespace to look for plugin implementations.
\Drupal\Core\Extension\ModuleHandlerInterface$module_handlerThe module handler.
string$plugin_interfaceThe interface each plugin should implement.
string$plugin_definition_attribute_nameThe name of the attribute that contains the plugin definition.
string$tableThe table name used to store the collection of saved collection plugins in the drupal database.

Member Function Documentation

◆ createCollection()

Drupal\tripal\TripalVocabTerms\PluginManagers\TripalCollectionPluginManager::createCollection (   $name,
  $pluginId 
)

Creates and returns a new collection with the given name and plugin id. The given name must not already exist in this plugin manager's existing collection of plugins. The given plugin id must be a valid plugin implementation.

Parameters
string$nameThe collection name.
string$pluginIdThe plugin id.
Returns
Drupal\tripal\TripalVocabTerms\TripalCollectionPluginBase The new collection or NULL if an error occured.

◆ getCollectionList()

Drupal\tripal\TripalVocabTerms\PluginManagers\TripalCollectionPluginManager::getCollectionList ( )

Returns an array of collection names of all existing collections.

Returns
array Collection names.

◆ loadCollection()

Drupal\tripal\TripalVocabTerms\PluginManagers\TripalCollectionPluginManager::loadCollection (   $name,
string  $pluginId = '' 
)

Loads and returns an existing collection plugin with the given name. If the given name does not exist then NULL is returned.

Parameters
string$nameThe name.
string$pluginIdAn optional name of a collection plugin, e.g. 'chado_id_space', 'chado_vocabulary'. When this is specified, an ID space or a vocabulary that is not yet a collection can be automatically made into a collection.
Returns
\Drupal\tripal\TripalVocabTerms\TripalCollectionPluginBase|NULL The loaded collection plugin or NULL.

◆ removeCollection()

Drupal\tripal\TripalVocabTerms\PluginManagers\TripalCollectionPluginManager::removeCollection ( string  $name,
bool  $delete_backend = FALSE 
)

Removes the collection with the given name in this manager. If no such collection exists with the given name then this does nothing. !!!WARNING!!! If the data in the removed collection is referenced by other collections or entities this could cause data loss. This method must be used with extreme caution!

Parameters
string$nameThe collection name.
bool$delete_backendTRUE if we want to delete the record in the storage backend (e.g. chado) FALSE if we only want to remove it as a Tripal-managed Collection but leave the storage backend alone.
Returns
bool True if the matching collection was removed or false otherwise.

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