You are here

function node_expire_node_insert in Node expire 8

Same name and namespace in other branches
  1. 7.2 node_expire.module \node_expire_node_insert()
  2. 7 node_expire.module \node_expire_node_insert()

Implements hook_nodeapi_insert().

File

./node_expire.module, line 240
Set a timer into your content, allowing you to perform customized actions.

Code

function node_expire_node_insert(\Drupal\node\NodeInterface $node) {

  // Only deal with node types that have the Node expire feature enabled.
  // @FIXME
  // Could not extract the default value because it is either indeterminate, or
  // not scalar. You'll need to provide a default value in
  // config/install/node_expire.settings.yml and config/schema/node_expire.schema.yml.
  $ntypes = \Drupal::config('node_expire.settings')
    ->get('node_expire_ntypes');
  if (!isset($ntypes[$node->type])) {
    return;
  }
  if (!($ntype = $ntypes[$node->type])) {
    return;
  }
  module_load_include('nodeapi.inc', 'node_expire');
  _node_expire_node_update_insert($ntype, $node);
}