You are here

class LayoutDeriver in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Layout/LayoutPluginManagerTest.php \Drupal\Tests\Core\Layout\LayoutDeriver

Provides a dynamic layout deriver for the test.

Hierarchy

Expanded class hierarchy of LayoutDeriver

File

core/tests/Drupal/Tests/Core/Layout/LayoutPluginManagerTest.php, line 393

Namespace

Drupal\Tests\Core\Layout
View source
class LayoutDeriver extends DeriverBase {

  /**
   * {@inheritdoc}
   */
  public function getDerivativeDefinitions($base_plugin_definition) {
    if ($base_plugin_definition
      ->get('array_based')) {
      $this->derivatives['array_based'] = [];
    }
    if ($base_plugin_definition
      ->get('invalid_provider')) {
      $this->derivatives['invalid_provider'] = new LayoutDefinition([
        'id' => 'invalid_provider',
        'provider' => 'invalid_provider',
      ]);
    }
    return $this->derivatives;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DeriverBase::$derivatives protected property List of derivative definitions. 1
DeriverBase::getDerivativeDefinition public function Gets the definition of a derivative plugin. Overrides DeriverInterface::getDerivativeDefinition
LayoutDeriver::getDerivativeDefinitions public function Gets the definition of all derivatives of a base plugin. Overrides DeriverBase::getDerivativeDefinitions