You are here

function radioactivity_add_energy in Radioactivity 5

Same name and namespace in other branches
  1. 6 radioactivity.inc \radioactivity_add_energy()

Add energy to nodes.

Parameters

$oid Object id:

$oclass Object base class, e.g. 'node'. Subclass will be resolved if necessary:

$source Energy source, e.g. 'view':

Return value

TRUE if successful

File

./radioactivity.inc, line 164

Code

function radioactivity_add_energy($oid, $oclass, $source, $allow_delayed_processing = FALSE) {
  if ($allow_delayed_processing && radioactivity_get_memcached_enable()) {

    // postpone event to memcache
    if (radioactivity_write_memcache_entry(array(
      'type' => 'add-energy',
      'oid' => $oid,
      'oclass' => $oclass,
      'source' => $source,
    ))) {
      return TRUE;
    }
  }
  return _radioactivity_add_energy_internal($oid, $oclass, $source);
}