You are here

function spambot_node_insert in Spambot 8

Same name and namespace in other branches
  1. 7 spambot.module \spambot_node_insert()

Implements hook_node_insert().

File

./spambot.module, line 621
Main module file.

Code

function spambot_node_insert($node) {
  $connection = \Drupal::database();
  $connection
    ->insert('node_spambot')
    ->fields([
    'nid' => $node
      ->id(),
    'uid' => $node
      ->getOwnerId(),
    'hostname' => \Drupal::request()
      ->getClientIp(),
  ])
    ->execute();
}