class LayoutDeriver

Same name in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/Layout/LayoutPluginManagerTest.php \Drupal\Tests\Core\Layout\LayoutDeriver
  2. 10 core/tests/Drupal/Tests/Core/Layout/LayoutPluginManagerTest.php \Drupal\Tests\Core\Layout\LayoutDeriver
  3. 11.x 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 394

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',
            ]);
            $this->derivatives['invalid_provider']
                ->setClass(LayoutInterface::class);
        }
        return $this->derivatives;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title 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

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