Tripal
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, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, $pluginInterface, $pluginDefinitionAnnotation, $table)
 
 createCollection ($name, $pluginId)
 
 removeCollection ($name)
 
 getCollectionList ()
 
 loadCollection ($name)
 

Detailed Description

Provides a tripal collection plugin manager.

Constructor & Destructor Documentation

◆ __construct()

Drupal\tripal\TripalVocabTerms\PluginManagers\TripalCollectionPluginManager::__construct (   $subdir,
\Traversable  $namespaces,
CacheBackendInterface  $cache_backend,
ModuleHandlerInterface  $module_handler,
  $pluginInterface,
  $pluginDefinitionAnnotation,
  $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_annotation_nameThe name of the annotation 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)

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.
Returns
Drupal\tripal\TripalVocabTerms\TripalCollectionPluginBase|NULL The loaded collection plugin or NULL.

◆ removeCollection()

Drupal\tripal\TripalVocabTerms\PluginManagers\TripalCollectionPluginManager::removeCollection (   $name)

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.
Returns
bool True if the matching collection was removed or false otherwise.

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