function MockLayoutBlockDeriver::getDerivativeDefinition

Same name and namespace in other branches
  1. 11.x core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/mock_block/MockLayoutBlockDeriver.php \Drupal\plugin_test\Plugin\plugin_test\mock_block\MockLayoutBlockDeriver::getDerivativeDefinition()
  2. 10 core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/mock_block/MockLayoutBlockDeriver.php \Drupal\plugin_test\Plugin\plugin_test\mock_block\MockLayoutBlockDeriver::getDerivativeDefinition()
  3. 8.9.x core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/mock_block/MockLayoutBlockDeriver.php \Drupal\plugin_test\Plugin\plugin_test\mock_block\MockLayoutBlockDeriver::getDerivativeDefinition()

File

core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/mock_block/MockLayoutBlockDeriver.php, line 20

Class

MockLayoutBlockDeriver
Mock implementation of DeriverInterface for the mock layout block plugin.

Namespace

Drupal\plugin_test\Plugin\plugin_test\mock_block

Code

public function getDerivativeDefinition($derivative_id, $base_plugin_definition) {
  $derivatives = $this->getDerivativeDefinitions($base_plugin_definition);
  if (isset($derivatives[$derivative_id])) {
    return $derivatives[$derivative_id];
  }
  return NULL;
}

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