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];
    }
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];
    }
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 ] ; }
Generates SQL subquery and parameters for 'from' pagination.

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