interface PluginCollectionInterface in Extensible BBCode 4.0.x
Same name and namespace in other branches
- 8.3 src/PluginCollectionInterface.php \Drupal\xbbcode\PluginCollectionInterface
Common methods to access a plugin collection.
This abstraction has the simple purpose of allowing functions to take both an associative array of plugins and a full plugin collection instance.
@todo This interface defines methods implemented in Drupal core, which lack parameter types. Fix after strict typing is added to Drupal core in https://drupal.org/project/drupal/issues/3050720
Hierarchy
- interface \Drupal\xbbcode\PluginCollectionInterface extends \Drupal\xbbcode\ArrayAccess \Drupal\xbbcode\Countable \Drupal\xbbcode\IteratorAggregate
Expanded class hierarchy of PluginCollectionInterface
All classes that implement PluginCollectionInterface
File
- src/
PluginCollectionInterface.php, line 15
Namespace
Drupal\xbbcodeView source
interface PluginCollectionInterface extends \ArrayAccess, \Countable, \IteratorAggregate {
/**
* Determines if a plugin instance exists.
*
* @param string $instance_id
* The ID of the plugin instance to check.
*
* @return bool
* TRUE if the plugin instance exists, FALSE otherwise.
*
* @noinspection PhpMissingParamTypeInspection
*/
public function has($instance_id) : bool;
/**
* Gets a plugin instance, initializing it if necessary.
*
* @param string $instance_id
* The ID of the plugin instance being retrieved.
*
* @noinspection PhpMissingParamTypeInspection
*/
public function &get($instance_id);
/**
* Stores an initialized plugin.
*
* @param string $instance_id
* The ID of the plugin instance being stored.
* @param mixed $value
* An instantiated plugin.
*
* @noinspection PhpMissingParamTypeInspection
*/
public function set($instance_id, $value);
/**
* Removes an initialized plugin.
*
* The plugin can still be used; it will be reinitialized.
*
* @param string $instance_id
* The ID of the plugin instance to remove.
*
* @noinspection PhpMissingParamTypeInspection
*/
public function remove($instance_id);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PluginCollectionInterface:: |
public | function | Gets a plugin instance, initializing it if necessary. | |
PluginCollectionInterface:: |
public | function | Determines if a plugin instance exists. | |
PluginCollectionInterface:: |
public | function | Removes an initialized plugin. | |
PluginCollectionInterface:: |
public | function | Stores an initialized plugin. |