You are here

social_node.module in Open Social 8.9

The social node module alterations.

File

modules/social_features/social_node/social_node.module
View source
<?php

/**
 * @file
 * The social node module alterations.
 */
use Drupal\social_node\Entity\Node;
use Drupal\social_node\NodeViewBuilder;

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

  /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
  if (isset($entity_types['node'])) {
    $entity_types['node']
      ->setClass(Node::class);
    $entity_types['node']
      ->setViewBuilderClass(NodeViewBuilder::class);
  }
}

Functions