You are here

class ReactBlockDeriver in Decoupled Blocks 8

Derives block plugin definitions for React components.

Hierarchy

Expanded class hierarchy of ReactBlockDeriver

File

modules/pdb_react/src/Plugin/Derivative/ReactBlockDeriver.php, line 10

Namespace

Drupal\pdb_react\Plugin\Derivative
View source
class ReactBlockDeriver extends PdbBlockDeriver {

  /**
   * {@inheritdoc}
   */
  public function getDerivativeDefinitions($base_plugin_definition) {
    $definitions = parent::getDerivativeDefinitions($base_plugin_definition);
    return array_filter($definitions, function (array $definition) {
      return $definition['info']['presentation'] == 'react';
    });
  }

}

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
PdbBlockDeriver::$componentDiscovery protected property The component discovery service.
PdbBlockDeriver::create public static function Creates a new class instance. Overrides ContainerDeriverInterface::create
PdbBlockDeriver::createContexts protected function Creates the context definitions required by a block plugin.
PdbBlockDeriver::__construct public function PdbBlockDeriver constructor.
ReactBlockDeriver::getDerivativeDefinitions public function Gets the definition of all derivatives of a base plugin. Overrides PdbBlockDeriver::getDerivativeDefinitions