You are here

function radioactivity_unique_emit_id in Radioactivity 4.0.x

Returns a unique emission counter.

Used to uniquely identify an emitter on a page. This was build as a static counter to work across multiple entities and/or multiple formatters and fields displayed on the same page.

Return value

int The emit ID.

2 calls to radioactivity_unique_emit_id()
RadioactivityEmitter::viewElements in src/Plugin/Field/FieldFormatter/RadioactivityEmitter.php
Builds a renderable array for a field value.
RadioactivityReferenceEmitter::viewElements in src/Plugin/Field/FieldFormatter/RadioactivityReferenceEmitter.php
Builds a renderable array for a field value.

File

./radioactivity.module, line 166
Provides a field type which can be used as a hotness metric.

Code

function radioactivity_unique_emit_id() {
  static $id = 0;
  return $id++;
}