You are here

mongodb_node.module in MongoDB 8

File

mongodb_node/mongodb_node.module
View source
<?php

/**
 * @file
 * Contains mongodb_node.module
 */

/**
 * Implements hook_entity_type_alter
 */
function mongodb_node_entity_type_alter(array &$entity_types) {

  /** @var \Drupal\Core\Config\Entity\ConfigEntityType[] $entity_types */
  foreach ($entity_types as $entity_type) {
    if ($entity_type
      ->getStorageClass() == 'Drupal\\node\\NodeStorage') {
      $entity_type
        ->setStorageClass('Drupal\\mongodb_node\\MongodbNodeStorage');
    }
  }
}

Functions

Namesort descending Description
mongodb_node_entity_type_alter Implements hook_entity_type_alter