social_node.module in Open Social 10.3.x
Same filename and directory in other branches
The social node module alterations.
File
modules/social_features/social_node/social_node.moduleView source
<?php
/**
* @file
* The social node module alterations.
*/
use Drupal\social_node\Entity\Node;
use Drupal\social_node\SocialNodeForm;
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);
foreach ([
'default',
'edit',
] as $operation) {
$entity_types['node']
->setFormClass($operation, SocialNodeForm::class);
}
}
}
Functions
Name | Description |
---|---|
social_node_entity_type_alter | Implements hook_entity_type_alter(). |