protected function timefield_pagination_from(
        $field,
        $timefrom,
        $lastseentime = null,
        $lastseenid = null,
        $withduration = true
    ) {
        $where = '';
        $params = [];

        if ($lastseentime && $lastseentime >= $timefrom) {
            $where = '((timesort = :timefrom1 AND e.id > :timefromid) OR timesort > :timefrom2)';
            if ($field === 'timestart') {
                $where = '((timestart = :timefrom1 AND e.id > :timefromid) OR timestart > :timefrom2' .
                       ($withduration ? ' OR timestart + timeduration > :timefrom3' : '') . ')';
            }
            $params['timefromid'] = $lastseenid;
            $params['timefrom1'] = $lastseentime;
            $params['timefrom2'] = $lastseentime;
            $params['timefrom3'] = $lastseentime;
        } else {
            $where = 'timesort >= :timefrom';
            if ($field === 'timestart') {
                $where = '(timestart >= :timefrom' .
                       ($withduration ? ' OR timestart + timeduration > :timefrom2' : '') . ')';
            }

            $params['timefrom'] = $timefrom;
            $params['timefrom2'] = $timefrom;
        }

        return ['where' => [$where], 'params' => $params];
    }