You are here

public static function DbHandler::writeRecord in Node expire 7.2

Writes node_expire record.

1 call to DbHandler::writeRecord()
NodeHookHandler::doNodeUpdateInsert in src/Module/Hook/NodeHookHandler.php
Implements hook_node_update() and hook_node_insert().

File

src/Module/Db/DbHandler.php, line 63
DbHandler class.

Class

DbHandler
DbHandler class.

Namespace

Drupal\node_expire\Module\Db

Code

public static function writeRecord($node_expire, $nid) {

  // Check, is it insert or update.
  $cnt = self::getNodeExpireCountByNid($nid);

  // Write the record.
  if ($cnt == 0) {

    // Insert.
    drupal_write_record('node_expire', $node_expire);
  }
  else {

    // Update.
    drupal_write_record('node_expire', $node_expire, 'nid');
  }
}