You are here

class BulkEditDeriver in Views Bulk Edit 8

A action deriver.

Hierarchy

Expanded class hierarchy of BulkEditDeriver

File

src/Plugin/Derivative/BulkEditDeriver.php, line 10

Namespace

Drupal\views_bulk_edit\Plugin\Derivative
View source
class BulkEditDeriver extends DeriverBase {

  /**
   * {@inheritdoc}
   */
  public function getDerivativeDefinitions($base_plugin_definition) {
    foreach ($this
      ->getEnabledEntityTypeIds() as $entity_type_id) {
      $this->derivatives[$entity_type_id] = $base_plugin_definition;
      $this->derivatives[$entity_type_id]['type'] = $entity_type_id;
    }
    return $this->derivatives;
  }

  /**
   * Getes the enabled entity type Ids.
   *
   * @return array
   *   An array of enabled entity type Ids.
   */
  protected function getEnabledEntityTypeIds() {
    return \Drupal::config('views_bulk_edit.settings')
      ->get('enabled_entity_type_ids') ?: [
      'node',
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BulkEditDeriver::getDerivativeDefinitions public function Gets the definition of all derivatives of a base plugin. Overrides DeriverBase::getDerivativeDefinitions
BulkEditDeriver::getEnabledEntityTypeIds protected function Getes the enabled entity type Ids.
DeriverBase::$derivatives protected property List of derivative definitions. 1
DeriverBase::getDerivativeDefinition public function Gets the definition of a derivative plugin. Overrides DeriverInterface::getDerivativeDefinition