You are here

forward_test.module in Forward 8

mollom_test.module: Main module file for hooks related to testing Forward.

File

tests/modules/forward_test/forward_test.module
View source
<?php

/**
 * @file mollom_test.module: Main module file for hooks related to testing Forward.
 */
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\user\UserInterface;

/**
 * Implements hook_forward_entity().
 *
 * @param $account
 *   The user account of the person who forwarded.
 * @param $entity
 *   The entity that was forwarded.
 * @param $form_state
 *   A form_state being processed.
 */
function forward_test_forward_entity(UserInterface $account, EntityInterface $entity, FormStateInterface $form_state) {

  // Example: redirect to the home page
  $form_state
    ->setRedirect('<front>');
}

Functions