20 use Wikimedia\Timestamp\TimestampException;
54 $this->rangeConds = [];
57 if ( $startTime !==
'' ) {
59 $this->startOffset = $this->mDb->timestamp( $startTimestamp->getTimestamp() );
60 $this->rangeConds[] = $this->mDb->buildComparison(
'>=',
64 if ( $endTime !==
'' ) {
68 $endTimestamp->timestamp = $endTimestamp->timestamp->modify(
'+1 second' );
69 $this->endOffset = $this->mDb->timestamp( $endTimestamp->getTimestamp() );
70 $this->rangeConds[] = $this->mDb->buildComparison(
'<',
74 $this->mYear = (int)$endTimestamp->format(
'Y' );
75 $this->mMonth = (int)$endTimestamp->format(
'm' );
76 $this->mDay = (int)$endTimestamp->format(
'd' );
78 }
catch ( TimestampException $ex ) {
100 [ $tables, $fields, $conds, $fname, $options, $join_conds ] = parent::buildQueryInfo(
106 if ( $this->startOffset ) {
107 $conds[] = $this->mDb->buildComparison(
'>=', [ $this->
getTimestampField() => $this->startOffset ] );
108 } elseif ( $this->rangeConds ) {
110 $conds = array_merge( $conds, $this->rangeConds );
113 return [ $tables, $fields, $conds, $fname, $options, $join_conds ];
static getInstance( $ts=false)
Get a timestamp instance in GMT.