public function setWhen($cmp)
    {
        $idx = array_search($cmp, self::$timeComparisons, true);
        if ($idx === null) {
            $this->setError("Invalid value for " . self::WHEN_KEY . ": " . $cmp);
        } else {
            $this->cmp = $idx;
        }
    }