You are here

function scheduler_handler_field_scheduler_countdown::query in Scheduler 6

File

./scheduler_handler_field_scheduler_countdown.inc, line 50
Implementation of scheduler_handler_scheduler_countdown field handler

Class

scheduler_handler_field_scheduler_countdown
Field handler to display a countdown until a scheduled action

Code

function query() {
  $this
    ->ensure_my_table();
  $this->node_table = $this->query
    ->ensure_table('node', $this->relationship);
  $time_field = $this->definition['timestamp_field'];
  $this->field_alias = $this->query
    ->add_field(NULL, 'IF(' . $time_field . ' AND ' . $time_field . ' > UNIX_TIMESTAMP(), ' . $time_field . ' - UNIX_TIMESTAMP(), NULL)', $this->table_alias . '_' . $this->field);
}