Provides a tripal collection plugin manager.
◆ __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 | $subdir | The plugin's subdirectory, for example Plugin/views/filter. |
\Traversable | $namespaces | An object that implements \Traversable which contains the root paths keyed by the corresponding namespace to look for plugin implementations. |
\Drupal\Core\Extension\ModuleHandlerInterface | $module_handler | The module handler. |
string | $plugin_interface | The interface each plugin should implement. |
string | $plugin_definition_annotation_name | The name of the annotation that contains the plugin definition. |
string | $table | The table name used to store the collection of saved collection plugins in the drupal database. |
◆ 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 | $name | The collection name. |
string | $pluginId | The 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
-
- 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 | $name | The 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:
- tripal/src/TripalVocabTerms/PluginManagers/TripalCollectionPluginManager.php