You are here

Ng2BlockDeriver.php in Decoupled Blocks 8

File

modules/pdb_ng2/src/Plugin/Derivative/Ng2BlockDeriver.php
View source
<?php

namespace Drupal\pdb_ng2\Plugin\Derivative;

use Drupal\pdb\Plugin\Derivative\PdbBlockDeriver;

/**
 * Derives block plugin definitions for Angular 2 components.
 */
class Ng2BlockDeriver 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'] == 'ng2';
    });
  }

}

Classes

Namesort descending Description
Ng2BlockDeriver Derives block plugin definitions for Angular 2 components.