protected function timefield_pagination_to(
        $field,
        $timeto,
        $lastseentime = null,
        $lastseenid = null
    ) {
        $where = [];
        $params = [];

        if ($lastseentime && $lastseentime > $timeto) {
            // The last seen event from this set is after the time sort range which
            // means all events in this range have been seen, so we can just return
            // early here.
            return false;
        } else if ($lastseentime && $lastseentime == $timeto) {
            $where[] = '((timesort = :timeto1 AND e.id > :timetoid) OR timesort < :timeto2)';
            if ($field === 'timestart') {
                $where[] = '((timestart = :timeto1 AND e.id > :timetoid) OR timestart < :timeto2)';
            }
            $params['timetoid'] = $lastseenid;
            $params['timeto1'] = $timeto;
            $params['timeto2'] = $timeto;
        } else {
            $where[] = ($field === 'timestart' ? 'timestart' : 'timesort') . ' <= :timeto';
            $params['timeto'] = $timeto;
        }

        return ['where' => $where, 'params' => $params];
    }
protected function timefield_pagination_to(
        $field,
        $timeto,
        $lastseentime = null,
        $lastseenid = null
    ) {
        $where = [];
        $params = [];

        if ($lastseentime && $lastseentime > $timeto) {
            // The last seen event from this set is after the time sort range which
            // means all events in this range have been seen, so we can just return
            // early here.
            return false;
        } else if ($lastseentime && $lastseentime == $timeto) {
            $where[] = '((timesort = :timeto1 AND e.id > :timetoid) OR timesort < :timeto2)';
            if ($field === 'timestart') {
                $where[] = '((timestart = :timeto1 AND e.id > :timetoid) OR timestart < :timeto2)';
            }
            $params['timetoid'] = $lastseenid;
            $params['timeto1'] = $timeto;
            $params['timeto2'] = $timeto;
        } else {
            $where[] = ($field === 'timestart' ? 'timestart' : 'timesort') . ' <= :timeto';
            $params['timeto'] = $timeto;
        }

        return ['where' => $where, 'params' => $params];
    }
protected function timefield_pagination_to ( $ field , $ timeto , $ lastseentime = null , $ lastseenid = null ) { $ where = [ ] ; $ params = [ ] ; if ( $ lastseentime && $ lastseentime > $ timeto ) { // The last seen event from this set is after the time sort range which // means all events in this range have been seen, so we can just return // early here. return false ; } else if ( $ lastseentime && $ lastseentime == $ timeto ) { $ where [ ] = '((timesort = :timeto1 AND e.id > :timetoid) OR timesort < :timeto2)' ; if ( $ field === 'timestart' ) { $ where [ ] = '((timestart = :timeto1 AND e.id > :timetoid) OR timestart < :timeto2)' ; } $ params [ 'timetoid' ] = $ lastseenid ; $ params [ 'timeto1' ] = $ timeto ; $ params [ 'timeto2' ] = $ timeto ; } else { $ where [ ] = ( $ field === 'timestart' ? 'timestart' : 'timesort' ) . ' <= :timeto' ; $ params [ 'timeto' ] = $ timeto ; } return [ 'where' => $ where , 'params' => $ params ] ; }
Generates SQL subquery and parameters for 'to' pagination.

@param string   $field
@param int      $timeto
@param int|null $lastseentime
@param int|null $lastseenid
@return array|bool
Generates SQL subquery and parameters for to pagination .