You are here

function finder_alias in Finder 7.2

Same name and namespace in other branches
  1. 6 finder.module \finder_alias()
  2. 7 finder.module \finder_alias()

Build aliases in consistent manner.

Only the $type and $eid are required, but you can supply as many params as is needed, as long as your usage is consistent between places where it needs to be.

Parameters

$type: The type of alias ('table', or 'field').

$eid: The finder element id.

$table: The raw table name.

$field: The raw field name.

$delta: A meaningful extra value.

Return value

The alias string.

1 call to finder_alias()
finder_build_display_query in includes/build.inc
Does stuff during the display handler's query.

File

includes/build.inc, line 457
The finder build functions.

Code

function finder_alias($type, $eid, $table = NULL, $field = NULL, $delta = NULL) {
  static $aliases = array();
  static $alias_count = array();
  if (!isset($alias_count[$type])) {
    $alias_count[$type] = 0;
  }
  $alias =& $aliases[$type][$eid][$table][$field][$delta];
  if (empty($alias)) {
    $alias = ++$alias_count[$type];
  }
  return 'finder_' . $type . '_' . $alias;
}