class LayoutDeriver in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Layout/LayoutPluginManagerTest.php \Drupal\Tests\Core\Layout\LayoutDeriver
 - 9 core/tests/Drupal/Tests/Core/Layout/LayoutPluginManagerTest.php \Drupal\Tests\Core\Layout\LayoutDeriver
 
Provides a dynamic layout deriver for the test.
Hierarchy
- class \Drupal\Component\Plugin\Derivative\DeriverBase implements DeriverInterface
- class \Drupal\Tests\Core\Layout\LayoutDeriver
 
 
Expanded class hierarchy of LayoutDeriver
File
- core/
tests/ Drupal/ Tests/ Core/ Layout/ LayoutPluginManagerTest.php, line 394  
Namespace
Drupal\Tests\Core\LayoutView 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',
      ]);
      $this->derivatives['invalid_provider']
        ->setClass(LayoutInterface::class);
    }
    return $this->derivatives;
  }
}Members
| 
            Name | 
                  Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| 
            DeriverBase:: | 
                  protected | property | List of derivative definitions. | |
| 
            DeriverBase:: | 
                  public | function | 
            Gets the definition of a derivative plugin. Overrides DeriverInterface:: | 
                  |
| 
            LayoutDeriver:: | 
                  public | function | 
            Gets the definition of all derivatives of a base plugin. Overrides DeriverBase:: |