You are here

function content_handler_sort::ensure_my_table in Content Construction Kit (CCK) 6.2

Same name and namespace in other branches
  1. 6.3 includes/views/handlers/content_handler_sort.inc \content_handler_sort::ensure_my_table()

File

includes/views/handlers/content_handler_sort.inc, line 54
Handles sorts and deals properly with multiple values by allowing the views administrator to select deltas.

Class

content_handler_sort
@file Handles sorts and deals properly with multiple values by allowing the views administrator to select deltas.

Code

function ensure_my_table() {
  if (!isset($this->table_alias)) {
    $join = $this
      ->get_join();
    if (!isset($join->extra)) {
      $join->extra = array();
    }
    $delta = isset($this->options['delta']) ? $this->options['delta'] : -1;
    if ($delta != -1) {
      $join->extra[] = array(
        'field' => 'delta',
        'value' => $delta,
        'numeric' => TRUE,
      );
    }
    $this->table_alias = $this->query
      ->ensure_table($this->table, $this->relationship, $join);
  }
  return $this->table_alias;
}