class TestDerivativeDiscoveryWithObject
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Plugin/Discovery/TestDerivativeDiscoveryWithObject.php \Drupal\Tests\Core\Plugin\Discovery\TestDerivativeDiscoveryWithObject
- 10 core/tests/Drupal/Tests/Core/Plugin/Discovery/TestDerivativeDiscoveryWithObject.php \Drupal\Tests\Core\Plugin\Discovery\TestDerivativeDiscoveryWithObject
- 11.x core/tests/Drupal/Tests/Core/Plugin/Discovery/TestDerivativeDiscoveryWithObject.php \Drupal\Tests\Core\Plugin\Discovery\TestDerivativeDiscoveryWithObject
Defines test derivative discovery using an object..
Hierarchy
- class \Drupal\Tests\Core\Plugin\Discovery\TestDerivativeDiscoveryWithObject implements \Drupal\Component\Plugin\Derivative\DeriverInterface
Expanded class hierarchy of TestDerivativeDiscoveryWithObject
File
-
core/
tests/ Drupal/ Tests/ Core/ Plugin/ Discovery/ TestDerivativeDiscoveryWithObject.php, line 10
Namespace
Drupal\Tests\Core\Plugin\DiscoveryView source
class TestDerivativeDiscoveryWithObject implements DeriverInterface {
/**
* {@inheritdoc}
* @param string $derivative_id
* @param array $base_plugin_definition
*
* @return array
*/
public function getDerivativeDefinition($derivative_id, $base_plugin_definition) {
$definitions = $this->getDerivativeDefinitions($base_plugin_definition);
return $definitions[$derivative_id];
}
/**
* {@inheritdoc}
* @param array $base_plugin_definition
*
* @return array
*/
public function getDerivativeDefinitions($base_plugin_definition) {
$plugins = [];
for ($i = 0; $i < 2; $i++) {
$plugins['test_discovery_' . $i] = $base_plugin_definition;
}
return $plugins;
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
TestDerivativeDiscoveryWithObject::getDerivativeDefinition | public | function | Overrides DeriverInterface::getDerivativeDefinition | |
TestDerivativeDiscoveryWithObject::getDerivativeDefinitions | public | function | Overrides DeriverInterface::getDerivativeDefinitions |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.