function TestDataTypeDeriver::getDerivativeDefinitions

Same name in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/Plugin/Fixtures/Plugin/DataType/TestDataTypeDeriver.php \Drupal\Tests\Core\Plugin\Fixtures\Plugin\DataType\TestDataTypeDeriver::getDerivativeDefinitions()
  2. 10 core/tests/Drupal/Tests/Core/Plugin/Fixtures/Plugin/DataType/TestDataTypeDeriver.php \Drupal\Tests\Core\Plugin\Fixtures\Plugin\DataType\TestDataTypeDeriver::getDerivativeDefinitions()
  3. 11.x core/tests/Drupal/Tests/Core/Plugin/Fixtures/Plugin/DataType/TestDataTypeDeriver.php \Drupal\Tests\Core\Plugin\Fixtures\Plugin\DataType\TestDataTypeDeriver::getDerivativeDefinitions()

Overrides DeriverBase::getDerivativeDefinitions

File

core/tests/Drupal/Tests/Core/Plugin/Fixtures/Plugin/DataType/TestDataTypeDeriver.php, line 15

Class

TestDataTypeDeriver
Provides a deriver that returns a plugin for the bare ID and one variant.

Namespace

Drupal\Tests\Core\Plugin\Fixtures\Plugin\DataType

Code

public function getDerivativeDefinitions($base_plugin_definition) {
    foreach ([
        '',
        'a_variant',
    ] as $item) {
        $this->derivatives[$item] = $base_plugin_definition;
        $this->derivatives[$item]['provider'] = 'core';
    }
    return $this->derivatives;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.