You are here

public static function Heartbeat::newTermUsage in Heartbeat 8

Parameters

$tid:

6 calls to Heartbeat::newTermUsage()
Heartbeat::updateTermUsage in src/Entity/Heartbeat.php
StatusForm::parseHashtags in modules/statusmessage/src/Form/StatusForm.php
StatusHeartPost::parseHashtags in modules/statusmessage/src/StatusHeartPost.php
StatusInstagram::processTerms in modules/statusmessage/src/StatusInstagram.php
StatusTwitter::processTerms in modules/statusmessage/src/StatusTwitter.php

... See full list

File

src/Entity/Heartbeat.php, line 953

Class

Heartbeat

Namespace

Drupal\heartbeat\Entity

Code

public static function newTermUsage($tid) {
  $insert = Database::getConnection()
    ->insert('heartbeat_term_usage')
    ->fields([
    'tid' => $tid,
    'timestamp' => time(),
  ]);
  if (!$insert
    ->execute()) {
    \Drupal::logger('Heartbeat')
      ->error('Unable to update term usage for Term with ID = %tid', array(
      '%tid' => $tid,
    ));
  }
}